NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2024-11831: Cross-site Scripting (XSS) in serialize-javascript

mediumCVSS 3.1 5.4GHSA-76p7-773f-r4q5

A flaw was found in npm-serialize-javascript. The vulnerability occurs because the serialize-javascript module does not properly sanitize certain inputs, such as regex or other JavaScript object types, allowing an attacker to inject malicious code. This code could be executed when deserialized by a web browser, causing Cross-site scripting (XSS) attacks.

Published Feb 10, 2025 · Updated Oct 15, 2026

Affected packages

serialize-javascript

Ecosystem
npm
Affected
>= 6.0.0, < 6.0.2
Fixed in
6.0.2
Check
npm ls serialize-javascript

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

A flaw was found in npm-serialize-javascript. The vulnerability occurs because the serialize-javascript module does not properly sanitize certain inputs, such as regex or other JavaScript object types, allowing an attacker to inject malicious code. This code could be executed when deserialized by a web browser, causing Cross-site scripting (XSS) attacks. This issue is critical in environments where serialized data is sent to web clients, potentially compromising the security of the website or web application using this package.

Credited to mhassan1.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More npm vulnerabilities

All npm entries