Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessControl a serialized function's toString()
-
DeliveryCraft source ending in bare </script
-
ExploitVictim loads page embedding serialized output
-
ExecutionBrowser closes <script> early, parses injected markup
-
Impact<img onerror> handler executes in victim context
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Four specific conditions must all hold: (1) the application uses serialize-javascript 7.0.1-7.1.3 to serialize data that includes a function value; (2) the attacker controls that function's source text, in practice via a spoofed toString() returning a body ending in exactly '</script' with no trailing delimiter character; (3) the serialized output is embedded inside an HTML <script> element and the surrounding output (or a later serialized value) supplies the closing '>' and injected markup - the advisory's example relies on the newline emitted by the { space } option; and (4) a victim loads the resulting page (UI:P / passive interaction). LIMITING FACTORS: ordinary function values end in '}' and are unaffected, and non-function values (even strings containing '</script') are escaped correctly, so the flaw cannot be triggered without attacker influence over a serialized function's source - a narrow, application-specific precondition. The complete fix is upgrading to 7.1.3; the only stated workaround if you cannot upgrade is to not serialize function values whose source/toString() an attacker can influence. |
| Impact | All decision signals point the same way: this is a low-priority issue. The supplied CVSS 4.0 base score is 2.3 (Low) with vector AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N - network-reachable and unauthenticated, but gated by an attack requirement (AT:P) and passive user interaction (UI:P), with no impact to the vulnerable system itself (VC/VI/VA all N) and only low confidentiality/integrity impact to a subsequent system (SC:L/SI:L), consistent with reflected XSS executing in a victim browser rather than compromising the server. The vuln.today decision label is 'monitor', not act_now or emergency. This is NOT in CISA KEV (status: not listed) and no EPSS score was provided, so there is no evidence of active or probable exploitation. The GHSA advisory contains a concrete reproduction (a public PoC reference exists; it is not verified as working exploit code in the input). The dominant limiting factor is the precondition: exploitation requires the attacker to already control the source text of a serialized function, in practice via a spoofed toString() - ordinary function values (which always end in '}') and non-function values are not affected. No signals conflict here; the low CVSS, 'monitor' label, absent KEV, and narrow precondition all agree this is a real-but-low-risk hardening fix, not an urgent threat. EPSS was not supplied, so probabilistic exploitation likelihood could not be cross-checked. |
| Exploit ScenarioDerived | An application serializes JavaScript objects (via serialize-javascript 7.0.1-7.1.3) and embeds the result inside a <script> element in an HTML page, where at least one serialized function's source text can be influenced by an attacker through a spoofed toString() returning a body ending in a bare '</script'. A victim loads the page; the surrounding output (e.g. the newline from the 'space' option) supplies the tag delimiter and a later serialized value supplies '>' plus markup, so the browser closes the script early and renders injected live markup such as an <img onerror> handler. A working reproduction is published in the GHSA advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 23, 2026
Cross-site scripting in serialize-javascript 7.0.1 before 7.1.3 occurs when a serialized function's attacker-influenced source text ends in a bare </script, letting surrounding output and a later serialized value complete the tag and inject live markup such as an img onerror handler. The flaw only affects applications that serialize attacker-controlled function values via a spoofed toString() and embed the result inside an HTML <script> element; ordinary functions and non-function values are escaped correctly. The vendor fixed this in 7.1.3, no KEV listing or confirmed active exploitation is reported, the advisory's demonstration payload is not verified as working exploit code, and the decision label is monitor.
RemediationAI
Upgrade to serialize-javascript 7.1.3, the vendor-released fixed version (advisory: https://github.com/yahoo/serialize-javascript/security/advisories/GHSA-m5mm-p8h7-m29v; release: https://github.com/yahoo/serialize-javascript/releases/tag/v7.1.3; fix: PR #235 and commit 2864b3c6260a3bfd52d2db3e70d1a079de108a61). If upgrading is not possible, the vendor's only stated workaround is to avoid serializing function values whose source text or toString() can be influenced by an attacker; doing so may break functionality that relies on serializing functions, and no other workaround is given.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
serialize-javascript is an npm/Node.js library that serializes JavaScript objects, including function values, into strings meant to be embedded in HTML <script> elements. It escapes characters such as <, >, /, U+2028 and U+2029 to prevent breaking out of the script context. The root cause is CWE-79: each function body is escaped independently, and SCRIPT_CLOSE_REGEXP only neutralized a bare </script when followed within the same body by TAB, LF, FF, CR, space, /, or >. A body ending exactly at </script had no following delimiter, so it was emitted unescaped; the surrounding output, for example the newline emitted by the space option, supplies the delimiter, and a later serialized value supplies > plus markup. Attacker control over a function's source text through a spoofed toString() is required, and the serialized result must be embedded in an HTML <script> element and loaded by a victim. Ordinary functions end in } and are unaffected, and non-function values, including strings containing </script, are escaped correctly. The fix adds an end-of-string $ alternative to the delimiter lookahead in SCRIPT_CLOSE_REGEXP, per PR #235 and commit 2864b3c6260a3bfd52d2db3e70d1a079de108a61.
Know when Serialize Javascript gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
Exploitation needs the attacker-controlled function-source precondition (AC:H, mapping the 4.0 AT:P) and a victim rendering the output (UI:R); XSS executing in the browser gives S:C with low C/I and no availability or server-side impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
More in Serialize Javascript
View allserialize-javascript prior to 3.1.0 allows remote attackers to inject arbitrary code via the function "deleteFunctions"
The serialize-javascript npm package before version 2.1.1 is vulnerable to Cross-site Scripting (XSS). Rated medium seve
Cross-site scripting in serialize-javascript before 7.1.3 lets an attacker who controls the source text of a serialized
EUVD-2026-108967
GHSA-cvqw-cqhx-qmxc
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB