Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS0zOTQ5LWY0OTQtY205Oc0uIQ

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

Permalink: https://github.com/advisories/GHSA-3949-f494-cm99
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS0zOTQ5LWY0OTQtY205Oc0uIQ
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: about 2 years ago
Updated: over 1 year ago


CVSS Score: 7.5
CVSS vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:L

Identifiers: GHSA-3949-f494-cm99, CVE-2022-23647
References: Repository: https://github.com/PrismJS/prism
Blast Radius: 40.0

Affected Packages

npm:prismjs
Dependent packages: 6,937
Dependent repositories: 218,739
Downloads: 29,374,399 last month
Affected Version Ranges: >= 1.14.0, < 1.27.0
Fixed in: 1.27.0
All affected versions: 1.14.0, 1.15.0, 1.16.0, 1.17.0, 1.17.1, 1.18.0, 1.19.0, 1.20.0, 1.21.0, 1.22.0, 1.23.0, 1.24.0, 1.24.1, 1.25.0, 1.26.0
All unaffected versions: 0.0.1, 1.1.0, 1.2.0, 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.3, 1.8.4, 1.9.0, 1.10.0, 1.11.0, 1.12.0, 1.12.2, 1.13.0, 1.27.0, 1.28.0, 1.29.0