Description
ansi2html versions 1.7.0a0 through 1.9.3 contain a cross-site scripting vulnerability in OSC 8 hyperlink handling that fails to validate or escape URL targets. Attackers controlling ANSI text input can inject javascript: schemes or terminate href attributes to execute arbitrary scripts in the context of pages displaying converted output.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| pycontribs | ansi2html | 1.7.0a0 – < 1.9.4 | 1.9.4 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | python-ansi2html | 1.9.5-1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | python-ansi2html | No fix yet | — |
| Ubuntu 26.04 LTS | python-ansi2html | No fix yet | — |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Tumbleweed | python-ansi2html | 1.9.5-1.1 | openSUSE-SU-2026:11815-1 |
Advisories 1
- openSUSE-SU-2026:11815-1 python313-ansi2html-1.9.5-1.1 on GA media SUSE / openSUSE Security Updates · Sep 19, 2026
References
- Patch Commit patch
- https://github.com/pycontribs/ansi2html/blob/v1.9.3/src/ansi2html/converter.py#L345-L349 technical-description
- https://github.com/pycontribs/ansi2html product
- VulnCheck Advisory: ansi2html 1.7.0a0 through 1.9.3 Cross-Site Scripting via OSC 8 third-party-advisory