{"id":"CVE-2026-28350","aliases":["CVE-2026-28350","GHSA-xvp8-3mhv-424c","PYSEC-2026-2202"],"related":[],"kind":"vulnerability","state":"published","title":"lxml_html_clean: <base> tag injection through default Cleaner configuration","summary":"lxml_html_clean is a project for HTML cleaning functionalities copied from `lxml.html.clean`. Prior to version 0.4.4, the <base> tag passes through the default Cleaner configuration. While page_structure=True removes html, head, and title tags, there is no specific handling for <base>, allowing an attacker to inject it and hijack relative links on the page. This issue has been patched in version 0.4.4.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"lxml_html_clean is a project for HTML cleaning functionalities copied from `lxml.html.clean`. Prior to version 0.4.4, the <base> tag passes through the default Cleaner configuration. While page_structure=True removes html, head, and title tags, there is no specific handling for <base>, allowing an attacker to inject it and hijack relative links on the page. This issue has been patched in version 0.4.4.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe `<base>` tag passes through the default `Cleaner` configuration. While `page_structure=True` removes `html`, `head`, and `title` tags, there is no specific handling for `<base>`, allowing an attacker to inject it and hijack relative links on the page.\n\n### Details\nThe `<base>` tag is not currently in the `page_structure` kill set. Even though the specification says `<base>` must be inside `<head>`, browsers accept `<base>` tags outside of the head.\n\nIf an attacker injects a `<base>` tag, it changes the base URL for all relative URLs on the page (links, images, scripts) to a domain controlled by the attacker.\n\n### PoC\n```python\nfrom lxml_html_clean import clean_html\n\n# The base tag is preserved in the output\nresult = clean_html('<base href=\"http://evil.com/\"><a href=\"/account\">Account</a>')\nprint(result)\n# Output: <div><base href=\"http://evil.com/\">...<a href=\"/account\">Account</a></div>\n```\n\n### Impact\nThe injection of a `<base>` tag allows an attacker to hijack the resolution of **all** relative URLs on the page. This results in three critical attack vectors:\n\n1.  **Phishing & Redirection:** Attackers can redirect user navigation (e.g., `<a href=\"/login\">`) and form submissions (e.g., `<form action=\"/auth\">`) to an attacker-controlled domain, effectively stealing credentials or sensitive data without the user realizing they have left the legitimate site.\n2.  **Cross-Site Scripting (XSS):** If the victim application loads JavaScript files using relative paths (e.g., `<script src=\"assets/app.js\">`), the browser will attempt to fetch the script from the attacker's domain. This upgrades the vulnerability from HTML injection to full Stored XSS.\n3.  **Defacement:** Relative references to images (`<img>`) and stylesheets (`<link>`) will be loaded from the attacker's server, allowing for UI redressing or defacement.","format":"markdown","source":"ghsa"},{"lang":"es","text":"lxml_html_clean es un proyecto para funcionalidades de limpieza de HTML copiadas de 'lxml.html.clean'. Antes de la versión 0.4.4, la etiqueta  pasa a través de la configuración predeterminada de Cleaner. Aunque page_structure=True elimina las etiquetas html, head y title, no hay un manejo específico para , permitiendo a un atacante inyectarla y secuestrar enlaces relativos en la página. Este problema ha sido parcheado en la versión 0.4.4.","source":"nvd"}],"published":"2026-03-02T19:35:52.000Z","modified":"2026-09-10T03:50:41.927Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-116"],"affected":[{"ranges":[{"version":"< 0.4.4","status":"affected"}],"vendor":"fedora-python","product":"lxml_html_clean","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.4.4"}],"ecosystem":"PyPI","package":"lxml-html-clean","purl":"pkg:pypi/lxml-html-clean","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.4.4"}],"vendor":"fedoralovespython","product":"lxml_html_clean","cpe":"cpe:2.3:a:fedoralovespython:lxml_html_clean:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.4.4"}],"ecosystem":"PyPI","package":"lxml-html-clean","purl":"pkg:pypi/lxml-html-clean","source":"pysec"}],"references":[{"url":"https://github.com/fedora-python/lxml_html_clean/security/advisories/GHSA-xvp8-3mhv-424c","tags":["evidence","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/fedora-python/lxml_html_clean/commit/9c5612ca33b941eec4178abf8a5294b103403f34","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-28350","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/fedora-python/lxml_html_clean","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-03-06T17:05:07.014Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-28350","url":"https://www.cve.org/CVERecord?id=CVE-2026-28350","licence":"CVE Terms of Use","modified":"2026-03-06T17:05:13.841Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-xvp8-3mhv-424c","url":"https://github.com/advisories/GHSA-xvp8-3mhv-424c","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:41.927Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-28350","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-28350","licence":"Public domain","modified":"2026-06-17T10:28:27.757Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2202","url":"https://osv.dev/vulnerability/PYSEC-2026-2202","licence":"CC-BY-4.0","modified":"2026-07-13T07:15:27.778Z"}],"updatedAt":"2026-11-25T22:59:15.334Z","epss":{"score":0.00303,"percentile":0.2491,"date":"2026-12-01T12:00:22.000Z"}}