GHSA-c9vm-hv86-f23r

Suggest an improvement
Source
https://github.com/advisories/GHSA-c9vm-hv86-f23r
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-c9vm-hv86-f23r/GHSA-c9vm-hv86-f23r.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-c9vm-hv86-f23r
Aliases
Published
2026-04-10T19:20:04Z
Modified
2026-08-24T03:56:00Z
Summary
justhtml includes multiple security fixes
Details

Summary

justhtml 1.15.0 includes multiple security fixes affecting URL sanitization helpers, HTML serialization, Markdown passthrough, and several custom sanitization-policy edge cases.

These issues have different impact levels and do not all affect the default configuration in the same way.

Affected versions

  • justhtml <= 1.14.0

Fixed version

  • justhtml 1.15.0 released on April 9, 2026

Impact overview

Helper and serialization issues

These issues could affect applications using JustHTML helpers or programmatic DOM construction, even outside the default HTML sanitization path.

  • 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.
  • 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.
  • Malformed bracketed hosts such as https://[evil.example]/x could raise exceptions and crash sanitization when host allowlists were used.
  • Programmatic element or attribute names containing markup-breaking characters could be serialized into active HTML.
  • Programmatic HTML comments containing --> could break out of the comment and inject live markup.

Markdown passthrough issue

  • to_markdown(html_passthrough=True) could reintroduce active HTML from sanitized <textarea> content by emitting a raw closing </textarea> sequence.

Custom policy issues

These issues affected custom policies more than the default safe configuration.

  • a[ping] was handled as a single URL even though browsers interpret it as a space-separated URL list.
  • attributionsrc was not treated as URL-bearing and could preserve attacker-controlled reporting endpoints.
  • link[imagesrcset] was not treated as URL-bearing and could preserve attacker-controlled image candidates.
  • Preserved <meta http-equiv="refresh"> tags could keep redirect targets without URL-policy enforcement.
  • Preserved <base href> tags could rewrite how later relative URLs resolved in the browser.
  • Preserved <style> blocks could keep resource-loading CSS such as @import, url(...), or image-set(...).
  • Mixed-case attribute names in custom transform pipelines could bypass or confuse security-related transforms such as DropAttrs(...), DropUrlAttrs(...), AllowStyleAttrs(...), and MergeAttrs(...).

Default configuration

Most of the custom-policy issues above did not affect the default JustHTML(..., sanitize=True) behavior.

The main exceptions were:

  • helper APIs such as clean_url_value(...)
  • programmatic DOM / serializer usage
  • applications explicitly using html_passthrough=True
  • applications using custom policies or custom transform pipelines

Recommended action

Upgrade to justhtml 1.15.0.

If you cannot upgrade immediately:

  • avoid html_passthrough=True for untrusted content
  • avoid preserving <style>, <meta http-equiv="refresh">, and <base href> in custom policies
  • avoid allowing ping, attributionsrc, or imagesrcset unless you explicitly validate them
  • avoid serializing untrusted programmatic node names, attribute names, or comment data
Database specific
{
    "cwe_ids":  [
        "CWE-178",
        "CWE-20",
        "CWE-755",
        "CWE-79"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-04-10T19:20:04Z",
    "nvd_published_at":  null,
    "severity":  "MODERATE"
}
References

Affected packages

PyPI / justhtml

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.15.0

Affected versions

0.*
0.1.0
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.5.2
0.6.0
0.7.0
0.8.0
0.9.0
0.10.0
0.11.0
0.12.0
0.13.0
0.13.1
0.14.0
0.15.0
0.16.0
0.17.0
0.18.0
0.19.0
0.20.0
0.21.0
0.22.0
0.23.0
0.24.0
0.25.0
0.26.0
0.27.0
0.28.0
0.29.0
0.30.0
0.31.0
0.32.0
0.33.0
0.34.0
0.35.0
0.36.0
0.37.0
0.38.0
0.39.0
0.40.0
1.*
1.0.0
1.1.0
1.2.0
1.3.0
1.4.0
1.5.0
1.6.0
1.7.0
1.8.0
1.9.0
1.9.1
1.10.0
1.11.0
1.12.0
1.13.0
1.14.0

Database specific

last_known_affected_version_range
"<= 1.14.0"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-c9vm-hv86-f23r/GHSA-c9vm-hv86-f23r.json"