{"id":"CVE-2026-5388","aliases":["CVE-2026-5388","GHSA-c9vm-hv86-f23r"],"related":[],"kind":"vulnerability","state":"published","title":"justhtml before 1.15.0 Multiple Security Issues","summary":"justhtml before 1.15.0 contains multiple security issues in URL sanitization helpers (clean_url_value/clean_url_in_js_string), HTML serialization, Markdown passthrough (html_passthrough=True), and several custom sanitization-policy edge cases. Depending on configuration, an attacker can bypass sanitization to inject active HTML and JavaScript — for example via encoded javascript: URLs, backslash-based relative URLs resolved as remote hosts, markup-breaking programmatic element/attribute names or HTML comments, raw </textarea> reintroduction through Markdown passthrough, or preserved <style>/<meta http-equiv=refresh>/<base href> tags in custom policies. Most custom-policy issues do not affect the default sanitize=True configuration; they primarily affect helper APIs, programmatic DOM construction, html_passthrough=True, and custom policies/transform pipelines.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"justhtml before 1.15.0 contains multiple security issues in URL sanitization helpers (clean_url_value/clean_url_in_js_string), HTML serialization, Markdown passthrough (html_passthrough=True), and several custom sanitization-policy edge cases. Depending on configuration, an attacker can bypass sanitization to inject active HTML and JavaScript — for example via encoded javascript: URLs, backslash-based relative URLs resolved as remote hosts, markup-breaking programmatic element/attribute names or HTML comments, raw </textarea> reintroduction through Markdown passthrough, or preserved <style>/<meta http-equiv=refresh>/<base href> tags in custom policies. Most custom-policy issues do not affect the default sanitize=True configuration; they primarily affect helper APIs, programmatic DOM construction, html_passthrough=True, and custom policies/transform pipelines.","source":"cvelist"},{"lang":"en","text":"## Summary\n\n`justhtml` `1.15.0` includes multiple security fixes affecting URL sanitization helpers, HTML serialization, Markdown passthrough, and several custom sanitization-policy edge cases.\n\nThese issues have different impact levels and do not all affect the default configuration in the same way.\n\n## Affected versions\n\n- `justhtml` `<= 1.14.0`\n\n## Fixed version\n\n- `justhtml` `1.15.0` released on April 9, 2026\n\n## Impact overview\n\n### Helper and serialization issues\nThese issues could affect applications using JustHTML helpers or programmatic DOM construction, even outside the default HTML sanitization path.\n\n- `JustHTML.clean_url_value(...)` and `clean_url_in_js_string(...)` could accept URL values such as `javascript&#58...`, which became active `javascript:` URLs after HTML attribute parsing.\n- URL sanitization could treat values like `\\\\evil.example/x` or `/\\\\evil.example/x` as safe relative URLs even though browsers could resolve them as remote requests.\n- Malformed bracketed hosts such as `https://[evil.example]/x` could raise exceptions and crash sanitization when host allowlists were used.\n- Programmatic element or attribute names containing markup-breaking characters could be serialized into active HTML.\n- Programmatic HTML comments containing `-->` could break out of the comment and inject live markup.\n\n### Markdown passthrough issue\n- `to_markdown(html_passthrough=True)` could reintroduce active HTML from sanitized `<textarea>` content by emitting a raw closing `</textarea>` sequence.\n\n### Custom policy issues\nThese issues affected custom policies more than the default safe configuration.\n\n- `a[ping]` was handled as a single URL even though browsers interpret it as a space-separated URL list.\n- `attributionsrc` was not treated as URL-bearing and could preserve attacker-controlled reporting endpoints.\n- `link[imagesrcset]` was not treated as URL-bearing and could preserve attacker-controlled image candidates.\n- Preserved `<meta http-equiv=\"refresh\">` tags could keep redirect targets without URL-policy enforcement.\n- Preserved `<base href>` tags could rewrite how later relative URLs resolved in the browser.\n- Preserved `<style>` blocks could keep resource-loading CSS such as `@import`, `url(...)`, or `image-set(...)`.\n- Mixed-case attribute names in custom transform pipelines could bypass or confuse security-related transforms such as `DropAttrs(...)`, `DropUrlAttrs(...)`, `AllowStyleAttrs(...)`, and `MergeAttrs(...)`.\n\n## Default configuration\n\nMost of the custom-policy issues above did **not** affect the default `JustHTML(..., sanitize=True)` behavior.\n\nThe main exceptions were:\n- helper APIs such as `clean_url_value(...)`\n- programmatic DOM / serializer usage\n- applications explicitly using `html_passthrough=True`\n- applications using custom policies or custom transform pipelines\n\n## Recommended action\n\nUpgrade to `justhtml` `1.15.0`.\n\nIf you cannot upgrade immediately:\n\n- avoid `html_passthrough=True` for untrusted content\n- avoid preserving `<style>`, `<meta http-equiv=\"refresh\">`, and `<base href>` in custom policies\n- avoid allowing `ping`, `attributionsrc`, or `imagesrcset` unless you explicitly validate them\n- avoid serializing untrusted programmatic node names, attribute names, or comment data","format":"markdown","source":"ghsa"},{"lang":"es","text":"justhtml anterior a 1.15.0 contiene múltiples problemas de seguridad en los ayudantes de saneamiento de URL (clean_url_value/clean_url_in_js_string), serialización HTML, paso a través de Markdown (html_passthrough=True), y varios casos límite de políticas de saneamiento personalizadas. Dependiendo de la configuración, un atacante puede eludir el saneamiento para inyectar HTML y JavaScript activos - por ejemplo, a través de URL javascript: codificadas, URL relativas basadas en barras invertidas resueltas como hosts remotos, nombres de elementos/atributos programáticos que rompen el marcado o comentarios HTML, reintroducción de </textarea> sin procesar a través del paso a través de Markdown, o etiquetas <style>/<meta http-equiv=refresh>/<base href> preservadas en políticas personalizadas. La mayoría de los problemas de las políticas personalizadas no afectan la configuración predeterminada sanitize=True; afectan principalmente a las API auxiliares, la construcción programática del DOM, html_passthrough=True, y las políticas personalizadas/pipelines de transformación.","source":"nvd"}],"published":"2026-04-10T19:20:04.000Z","modified":"2026-10-12T16:10:00.220Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":9.3,"rating":"CRITICAL"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":9.3,"rating":"CRITICAL"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"}],"cwes":["CWE-20","CWE-79","CWE-178","CWE-755"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"1.15.0","status":"affected"},{"type":"semver","version":"1.15.0","status":"unaffected"}],"vendor":"EmilStenstrom","product":"justhtml","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.15.0"}],"ecosystem":"PyPI","package":"justhtml","purl":"pkg:pypi/justhtml","source":"ghsa"}],"references":[{"url":"https://github.com/EmilStenstrom/justhtml/security/advisories/GHSA-c9vm-hv86-f23r","tags":["vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/justhtml-before-multiple-security-issues","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://github.com/EmilStenstrom/justhtml","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/EmilStenstrom/justhtml/compare/v1.14.0...v1.15.0","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/EmilStenstrom/justhtml/releases/tag/v1.15.0","tags":["web"],"sources":["ghsa"]}],"credits":["EmilStenstrom"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-08-26T16:07:56.131Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-5388","url":"https://www.cve.org/CVERecord?id=CVE-2026-5388","licence":"CVE Terms of Use","modified":"2026-08-26T16:16:10.959Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-c9vm-hv86-f23r","url":"https://github.com/advisories/GHSA-c9vm-hv86-f23r","licence":"CC-BY-4.0","modified":"2026-08-24T03:56:00.144Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-5388","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-5388","licence":"Public domain","modified":"2026-10-12T16:10:00.220Z"}],"updatedAt":"2026-11-25T22:59:34.966Z","epss":{"score":0.00345,"percentile":0.30059,"date":"2026-12-01T12:00:22.000Z"}}