Every CVE Search/ Get API key

CVE-2020-26237

Prototype Pollution in highlight.js

5.8 MediumFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
High
Privileges needed
Low
User interaction
Required

What an attacker can affect

Confidentiality
None
Integrity
High
Availability
None

Exploit likelihood

1.33%Unchanged since Apr 14, 2021
90%50%10%1%

What each source reports

CVE List Score used 5.8

Prototype Pollution in highlight.js

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.

Record
CVE-2020-26237
CVSS 3.1
5.8 MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:N
Weakness
CWE-471
Updated
2026-11-02
EUVDEUVD-2020-1472 5.8

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.

Record
EUVD-2020-1472
CVSS 3.1
5.8 MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:N
Updated
2026-11-03
GitHub AdvisoriesGHSA-vfrc-7r7c-w9mx 5.8

Prototype Pollution in highlight.js

Impact

Affected versions of this package 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.

Patches

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.

Workarounds

Patch your library

Manually patch your library to create null objects for both languages and aliases:

const HLJS = function(hljs) {
  // ...
  var languages = Object.create(null);
  var aliases = Object.create(null);

Filter out bad data from end users:

Filter the language names that users are allowed to inject into your HTML to guarantee they are valid.

References

For more information

If you have any questions or comments about this advisory:

Record
GHSA-vfrc-7r7c-w9mx
CVSS 3.1
5.8 MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:N
Weakness
CWE-471
Updated
2026-11-02
NVD 5.8

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.

Record
CVE-2020-26237
CVSS 3.1
5.8 MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:N
CVSS 3.1
8.7 HighCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:N/I:H/A:H
CVSS 2.0
4.9 MediumAV:N/AC:M/Au:S/C:N/I:P/A:P
Weakness
CWE-471
Updated
2026-11-02
OSV 8.7

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.

Record
CVE-2020-26237
CVSS 3.1
8.7 HighCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:N/I:H/A:H
Updated
2026-11-02
OSVDEBIAN-CVE-2020-26237 8.7

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.

Record
DEBIAN-CVE-2020-26237
CVSS 3.1
8.7 HighCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:N/I:H/A:H
Updated
2026-11-02
Show 4 moreShow less
OSVGHSA-vfrc-7r7c-w9mx 5.8

Prototype Pollution in highlight.js

Impact

Affected versions of this package 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.

Patches

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.

Workarounds

Patch your library

Manually patch your library to create null objects for both languages and aliases:

const HLJS = function(hljs) {
  // ...
  var languages = Object.create(null);
  var aliases = Object.create(null);

Filter out bad data from end users:

Filter the language names that users are allowed to inject into your HTML to guarantee they are valid.

References

For more information

If you have any questions or comments about this advisory:

Record
GHSA-vfrc-7r7c-w9mx
CVSS 3.1
5.8 MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:N
Weakness
CWE-471
Updated
2026-11-02
OSVUBUNTU-CVE-2020-26237 5.8

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.

Record
UBUNTU-CVE-2020-26237
CVSS 3.1
5.8 MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:N
CVSS 3.1
8.7 HighCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:N/I:H/A:H
Updated
2026-11-02
OSVCLSA-2026-1788553382 No score

TuxCare security update for highlight.js (1 CVE)

TuxCare rebuilt highlight.js to address 1 CVE. Fixed in 8.9.1-tuxcare.1.

Record
CLSA-2026-1788553382
Updated
2026-11-02
OSVUSN-8276-1 No score

Highlight.js vulnerability

It was discovered that Highlight.js used plain JavaScript objects for internal language name lookups, making them susceptible to prototype pollution attacks. An attacker could use this to cause a denial of service or unexpected application behaviour.

Record
USN-8276-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
highlight.js
npm
before 9.18.2
9.18.2
highlight.js
npm
10.0.0 up to 10.1.2
10.1.2
highlight.js
TuxCare:npm
8.9.1-tuxcare.0 up to 8.9.1-tuxcare.1, plus listed versions
8.9.1
8.9.1-tuxcare.1
highlight.js
Debian:12
before 9.18.1+dfsg1-3
9.18.1+dfsg1-3
highlight.js
Debian:13
before 9.18.1+dfsg1-3
9.18.1+dfsg1-3
highlight.js
Debian:14
before 9.18.1+dfsg1-3
9.18.1+dfsg1-3
highlight.js
Debian:9
before 8.2+ds-5+deb9u1, plus listed versions
8.2+ds-5
8.2+ds-5+deb9u1
highlight.js
Ubuntu:Pro:16.04:LTS
before 8.2+ds-4ubuntu0.1~esm1, plus listed versions
8.2+ds-4build1
8.2+ds-4ubuntu0.1~esm1
highlight.js
Ubuntu:Pro:18.04:LTS
before 9.12.0+dfsg1-4ubuntu0.1~esm1, plus listed versions
9.12.0+dfsg1-39.12.0+dfsg1-4
9.12.0+dfsg1-4ubuntu0.1~esm1
highlight.js
Ubuntu:Pro:20.04:LTS
before 9.12.0+dfsg1-5ubuntu0.1~esm1, plus listed versions
9.12.0+dfsg1-4ubuntu19.12.0+dfsg1-5
9.12.0+dfsg1-5ubuntu0.1~esm1

History

History
RecordedChangedSources
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2020-26237 is a medium vulnerability (CVSS 5.8) in Highlightjs Highlight.js, published November 24, 2020. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.33%, the 71st percentile. Fixed in highlight.js 9.18.2.

References

Show 7 moreShow less
MoveEnter Open