Cross-site Scripting in Prism
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- High
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- High · Low · Low
- Fix status
- Partial Red Hat: 2 fixed, 4 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-79.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| PrismJS | prism | 1.14.0 to before 1.27.0 | 1.27.0 | Patch available | CNA |
| — | prismjs (npm) | 1.14.0 to before 1.27.0 | 1.27.0 | Patch available | GHSA-3949-f494-cm99 |
- prism VendorPrismJS Affected 1.14.0 to before 1.27.0 Fixed in 1.27.0 Patch available CNA
- prismjs (npm) Vendor— Affected 1.14.0 to before 1.27.0 Fixed in 1.27.0 Patch available GHSA-3949-f494-cm99
Remediation
- Fix · CNA prism (PrismJS) Fixed in 1.27.0
- Fix · GHSA-3949-f494-cm99 prismjs (npm) Fixed in 1.27.0 Advisory →
Red Hat 2 advisories
- RHSA-2022:8524 Released 2022-11-17 · Red Hat rating ImportantRed Hat Data Grid 8.4.0 security update
- Red Hat Data Grid 8.4.0
- RHSA-2022:6835 Released 2022-10-06 · Red Hat rating ImportantService Registry (container images) release and security update [2.3.0.GA]
- RHINT Service Registry 2.3.0 GA
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| OpenShift Developer Tools and Services | Affected | No fix yet: Fix deferred |
| Red Hat 3scale API Management Platform 2 | Affected | No fix yet |
| Red Hat Integration Service Registry | Affected | No fix planned: Out of support scope |
| Red Hat OpenShift GitOps | Affected | No fix planned: Will not fix |
| RHINT Service Registry 2.3.0 GA | Fixed | RHSA-2022:6835 |
| Red Hat Data Grid 8.4.0 | Fixed | RHSA-2022:8524 |
Not affected: 17 products
- Migration Toolkit for Virtualization
- OpenShift Service Mesh 2.0
- OpenShift Service Mesh 2.1
- Red Hat A-MQ Online
- Red Hat Advanced Cluster Security 3
- Red Hat Ansible Automation Platform 2
- Red Hat Ceph Storage 3
- Red Hat Ceph Storage 4
- Red Hat Ceph Storage 5
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Red Hat Integration Camel K 1
- Red Hat Integration Camel Quarkus 1
- Red Hat Integration Data Virtualisation Operator
- Red Hat OpenShift Container Platform 3.11
- Red Hat OpenShift Container Platform 4
- Red Hat Storage 3
Timeline
- 2026-10-02 Threatist record created from CVE-2022-23647
- 2026-10-03 Alias added: GHSA-3949-f494-cm99
References
More PrismJS Prism vulnerabilities
- TI-2024-35787 Code injection in PrismJS Prism CVSS 3.1MEDIUM 5.4
- TI-2021-06039 Regular expression denial of service (ReDoS) in prismjs CVSS 3.1HIGH 7.5
- TI-2021-12391 Regular Expression Denial of Service (ReDoS) in Prism CVSS 3.1HIGH 7.4
- TI-2021-02732 Inefficient Regular Expression Complexity in prismjs/prism CVSS 3.1MEDIUM 6.5
Sources
- CVE-2022-23647 · CVE Program
- CVE-2022-23647 · NVD
- FIRST EPSS
- GHSA-3949-f494-cm99 · GitHub Advisory Database · CC BY 4.0
- CVE-2022-23647 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences