Description
Highlight.js is a syntax highlighter written in JavaScript. Highlight.js versions before 9.18.2 and 10.1.2 are vulnerable to Prototype Pollution. A malicious HTML code block can be crafted that will result in prototype pollution of the base object's prototype during highlighting. If you allow users to insert custom HTML code blocks into your page/app via parsing Markdown code blocks (or similar) and do not filter the language names the user can provide you may be vulnerable. The pollution should just be harmless data but this can cause problems for applications not expecting these properties to exist and can result in strange behavior or application crashes, i.e. a potential DOS vector. If your website or application does not render user provided data it should be unaffected. Versions 9.18.2 and 10.1.2 and newer include fixes for this vulnerability. If you are using version 7 or 8 you are encouraged to upgrade to a newer release.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| highlightjs | highlight.js | < 9.18.2, >= 10.0.0, < 10.1.2 | — |
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 | highlight.js | 9.18.1+dfsg1-3 | — |
| Debian 13 | highlight.js | 9.18.1+dfsg1-3 | — |
| Debian 12 | highlight.js | 9.18.1+dfsg1-3 | — |
| Debian 9 | highlight.js | 8.2+ds-5+deb9u1 | DLA-2511-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 20.04 LTS | highlight.js | 9.12.0+dfsg1-5ubuntu0.1~esm1 | — |
| Ubuntu Pro 18.04 LTS | highlight.js | 9.12.0+dfsg1-4ubuntu0.1~esm1 | — |
| Ubuntu Pro 16.04 LTS | highlight.js | 8.2+ds-4ubuntu0.1~esm1 | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| npm | highlight.js | < 9.18.2 | 9.18.2 | GHSA-vfrc-7r7c-w9mx |
| npm | highlight.js | >= 10.0.0, < 10.1.2 | 10.1.2 | GHSA-vfrc-7r7c-w9mx |
Advisories 2
- WID-SEC-2022-0735 Oracle MySQL: Mehrere Schwachstellen BSI CERT-Bund (WID) · May 19, 2026
- DLA-2511-1 highlight.js - security update Debian Security (DSA / DLA) · Mar 9, 2026
References
- https://github.com/highlightjs/highlight.js/security/advisories/GHSA-vfrc-7r7c-w9mx
- https://github.com/highlightjs/highlight.js/pull/2636
- https://www.npmjs.com/package/highlight.js
- https://github.com/highlightjs/highlight.js/commit/7241013ae011a585983e176ddc0489a7a52f6bb0
- [debian-lts-announce] 20201230 [SECURITY] [DLA 2511-1] highlight.js security update mailing-list
- https://www.oracle.com/security-alerts/cpujul2022.html