CVE-2026-115754
MediumCVSS 4.7Exploitation Probability (EPSS)
Low risk24th percentile - higher than 24% of all known CVEs
Summary
serialize-javascript from 7.0.1 before 7.1.3 contains a cross-site scripting vulnerability. Attackers can break out of HTML script elements by ending serialized function source text with an unescaped </script.
Risk Assessment
An attacker controlling a function's source via a spoofed toString() can inject live markup such as img onerror handlers, leading to script execution in the victim's browser.
Recommendation
Upgrade serialize-javascript to version 7.1.3 or later.
Other vulnerabilities in serialize-javascript
See all- CVE-2026-115897Low
Serialize JavaScript serializes JavaScript values to a superset of JSON that includes regular expressions and functions. Prior to 7.1.3, the function-source escaping logic does not neutralize a bare closing-script prefix when attacker-influenced function source text ends exactly at that prefix. Because each function body is escaped independently, a delimiter supplied by surrounding serialized output can terminate an HTML script element, and a later serialized value supplies injected markup that becomes a live element in the page. Exploitation requires control of a serialized function's source text, such as through a spoofed toString().
- CVE-2026-97711Low
Serialize JavaScript from version 7.1.1 until 7.1.2 does not fully protect serialized functions against script-closing tags in attacker-influenced function source. This can cause the script element to terminate early and the remaining output to be parsed as HTML, enabling cross-site scripting in the page origin. Only function values are affected, and the issue is fixed in version 7.1.2.
- CVE-2024-11831Medium
A flaw was found in npm-serialize-javascript where the module does not properly sanitize certain inputs like regex or other JavaScript object types, allowing an attacker to inject malicious code. This code can be executed during deserialization in a web browser, leading to Cross-site scripting (XSS) attacks.
Original NVD description (English source)
serialize-javascript from 7.0.1 before 7.1.3 contains a cross-site scripting vulnerability that allows attackers to break out of HTML script elements by ending serialized function source text with an unescaped </script. Attackers controlling a function's source via a spoofed toString() can combine surrounding output delimiters and later values to inject live markup such as img onerror handlers.
Vulnerability data from NVD (NIST) · CISA KEV · EPSS

