Every CVE Search/ Get API key

CVE-2022-23647

Cross-site Scripting in Prism

7.5 HighFix available

Prism is a syntax highlighting library. Starting with version 1.14.0 and prior to version 1.27.0, Prism's command line plugin can be used by attackers to achieve a cross-site scripting attack. The command line plugin did not properly escape its output, leading to the input text being inserted into the DOM as HTML code. Server-side usage of Prism is not impacted. Websites that do not use the Command Line plugin are also not impacted. This bug has been fixed in v1.27.0. As a workaround, do not use the command line plugin on untrusted inputs, or sanitize all code blocks (remove all HTML code text) from all code blocks that use the command line plugin.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
High
Privileges needed
None
User interaction
Required

What an attacker can affect

Confidentiality
High
Integrity
Low
Availability
Low

Exploit likelihood

1.43%Up 0.5 points since Feb 19, 2022
90%50%10%1%

What each source reports

CVE List Score used 7.5

Cross-site Scripting in Prism

Prism is a syntax highlighting library. Starting with version 1.14.0 and prior to version 1.27.0, Prism's command line plugin can be used by attackers to achieve a cross-site scripting attack. The command line plugin did not properly escape its output, leading to the input text being inserted into the DOM as HTML code. Server-side usage of Prism is not impacted. Websites that do not use the Command Line plugin are also not impacted. This bug has been fixed in v1.27.0. As a workaround, do not use the command line plugin on untrusted inputs, or sanitize all code blocks (remove all HTML code text) from all code blocks that use the command line plugin.

Record
CVE-2022-23647
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L
Weakness
CWE-79
Updated
2026-11-02
EUVDEUVD-2022-0785 7.5

Prism is a syntax highlighting library. Starting with version 1.14.0 and prior to version 1.27.0, Prism's command line plugin can be used by attackers to achieve a cross-site scripting attack. The command line plugin did not properly escape its output, leading to the input text being inserted into the DOM as HTML code. Server-side usage of Prism is not impacted. Websites that do not use the Command Line plugin are also not impacted. This bug has been fixed in v1.27.0. As a workaround, do not use the command line plugin on untrusted inputs, or sanitize all code blocks (remove all HTML code text) from all code blocks that use the command line plugin.

Record
EUVD-2022-0785
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L
Updated
2026-11-02
GitHub AdvisoriesGHSA-3949-f494-cm99 7.5

Cross-site Scripting in Prism

Impact

Prism's Command line plugin can be used by attackers to achieve an XSS attack. The Command line plugin did not properly escape its output, leading to the input text being inserted into the DOM as HTML code.

Server-side usage of Prism is not impacted. Websites that do not use the Command Line plugin are also not impacted.

Patches

This bug has been fixed in v1.27.0.

Workarounds

Do not use the Command line plugin on untrusted inputs, or sanitized all code blocks (remove all HTML code text) from all code blocks that use the Command line plugin.

References

Record
GHSA-3949-f494-cm99
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L
Weakness
CWE-79
Updated
2026-11-02
NVD 7.5

Prism is a syntax highlighting library. Starting with version 1.14.0 and prior to version 1.27.0, Prism's command line plugin can be used by attackers to achieve a cross-site scripting attack. The command line plugin did not properly escape its output, leading to the input text being inserted into the DOM as HTML code. Server-side usage of Prism is not impacted. Websites that do not use the Command Line plugin are also not impacted. This bug has been fixed in v1.27.0. As a workaround, do not use the command line plugin on untrusted inputs, or sanitize all code blocks (remove all HTML code text) from all code blocks that use the command line plugin.

Record
CVE-2022-23647
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L
CVSS 3.1
6.1 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
CVSS 2.0
4.3 MediumAV:N/AC:M/Au:N/C:N/I:P/A:N
Weakness
CWE-79
Updated
2026-11-02
OSV 7.5

Cross-site Scripting in Prism

Prism is a syntax highlighting library. Starting with version 1.14.0 and prior to version 1.27.0, Prism's command line plugin can be used by attackers to achieve a cross-site scripting attack. The command line plugin did not properly escape its output, leading to the input text being inserted into the DOM as HTML code. Server-side usage of Prism is not impacted. Websites that do not use the Command Line plugin are also not impacted. This bug has been fixed in v1.27.0. As a workaround, do not use the command line plugin on untrusted inputs, or sanitize all code blocks (remove all HTML code text) from all code blocks that use the command line plugin.

Record
CVE-2022-23647
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L
Weakness
CWE-79
Updated
2026-11-02
OSVDEBIAN-CVE-2022-23647 6.1

Prism is a syntax highlighting library. Starting with version 1.14.0 and prior to version 1.27.0, Prism's command line plugin can be used by attackers to achieve a cross-site scripting attack. The command line plugin did not properly escape its output, leading to the input text being inserted into the DOM as HTML code. Server-side usage of Prism is not impacted. Websites that do not use the Command Line plugin are also not impacted. This bug has been fixed in v1.27.0. As a workaround, do not use the command line plugin on untrusted inputs, or sanitize all code blocks (remove all HTML code text) from all code blocks that use the command line plugin.

Record
DEBIAN-CVE-2022-23647
CVSS 3.1
6.1 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Updated
2026-11-03
Show 4 moreShow less
OSVGHSA-3949-f494-cm99 7.5

Cross-site Scripting in Prism

Impact

Prism's Command line plugin can be used by attackers to achieve an XSS attack. The Command line plugin did not properly escape its output, leading to the input text being inserted into the DOM as HTML code.

Server-side usage of Prism is not impacted. Websites that do not use the Command Line plugin are also not impacted.

Patches

This bug has been fixed in v1.27.0.

Workarounds

Do not use the Command line plugin on untrusted inputs, or sanitized all code blocks (remove all HTML code text) from all code blocks that use the Command line plugin.

References

Record
GHSA-3949-f494-cm99
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L
Weakness
CWE-79
Updated
2026-11-02
OSVUBUNTU-CVE-2022-23647 7.5

Prism is a syntax highlighting library. Starting with version 1.14.0 and prior to version 1.27.0, Prism's command line plugin can be used by attackers to achieve a cross-site scripting attack. The command line plugin did not properly escape its output, leading to the input text being inserted into the DOM as HTML code. Server-side usage of Prism is not impacted. Websites that do not use the Command Line plugin are also not impacted. This bug has been fixed in v1.27.0. As a workaround, do not use the command line plugin on untrusted inputs, or sanitize all code blocks (remove all HTML code text) from all code blocks that use the command line plugin.

Record
UBUNTU-CVE-2022-23647
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L
CVSS 3.1
6.1 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Updated
2026-11-02
OSVCLSA-2026-1793304056 No score

TuxCare security update for prismjs (6 CVEs)

TuxCare rebuilt prismjs to address 6 CVEs. Fixed in 1.17.1-tuxcare.1.

Record
CLSA-2026-1793304056
Updated
2026-11-02
OSVROOT-APP-NPM-CVE-2022-23647 No score

CVE-2022-23647 in prismjs - Patched by Root

Root has patched CVE-2022-23647 in the prismjs package for Root:npm. Multiple fixed versions available.

Record
ROOT-APP-NPM-CVE-2022-23647
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
prismjs
npm
1.14.0 up to 1.27.0
1.27.0
prismjs
TuxCare:npm
From an advisory covering 6 CVEs
1.17.1-tuxcare.0 up to 1.17.1-tuxcare.1, plus listed versions
1.17.1
1.17.1-tuxcare.1
node-prismjs
Debian:12
before 1.27.0+dfsg+~1.26.0-1
1.27.0+dfsg+~1.26.0-1
node-prismjs
Debian:13
before 1.27.0+dfsg+~1.26.0-1
1.27.0+dfsg+~1.26.0-1
node-prismjs
Debian:14
before 1.27.0+dfsg+~1.26.0-1
1.27.0+dfsg+~1.26.0-1
prismjs
Root:npm
before 1.17.1-aikido.1
1.17.1-aikido.11.27.0-aikido.2
@rootio/prismjs
Root:npm
before 1.17.1-root.io.1
1.17.1-root.io.11.27.0-root.io.21.27.0-root.io.1
node-prismjs
Ubuntu:20.04:LTS
All versions, plus listed versions
1.11.0+dfsg-21.11.0+dfsg-3
None known
node-prismjs
Ubuntu:22.04:LTS
All versions, plus listed versions
1.23.0+dfsg-11.25.0+dfsg-11.27.0+dfsg+~1.26.0-1
None known

History

History
RecordedChangedSources
affected, factsOSV
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

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

In short

CVE-2022-23647 is a high vulnerability (CVSS 7.5) in Prismjs Prism, published February 18, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.43%, the 73rd percentile. Fixed in prismjs 1.27.0.

References

Show 5 moreShow less
MoveEnter Open