Skip to main content

serialize-javascript CVE-2026-115897

| EUVDEUVD-2026-109190 LOW
Cross-site Scripting (XSS) (CWE-79)
2026-10-23 GitHub_M GHSA-m5mm-p8h7-m29v
2.1
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Supply data with spoofed toString()
  2. Delivery
    App serializes function source ending in </script
  3. Exploit
    Surrounding output supplies delimiter, later value supplies markup
  4. Execution
    Serialized blob embedded in page script element
  5. Impact
    Script closes early, injected markup executes XSS

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

Requires an application to serialize a function value whose source text / toString() output is controllable by the attacker, and that function body must end exactly at a bare '</script' with no trailing delimiter character. The surrounding serialized output must then supply the delimiter (for example the newline emitted by the 'space' pretty-print option) and a later serialized value must supply the closing '>' followed by injected markup. The resulting serialized string must be embedded inside an HTML <script> element and rendered in a victim's browser. Limiting factors: ordinary functions end in '}' and are unaffected; non-function values and strings containing '</script' are escaped correctly; the attacker needs control over function source via a spoofed toString(); and a victim must load the page (passive user interaction). The only complete fix per the vendor is upgrading to 7.1.3; if upgrade is not possible, the vendor advises not serializing function values whose source text can be attacker-influenced.

Impact

This is a genuinely low-priority issue, and the signals are consistent rather than conflicting. The CVSS 4.0 base score is 2.1 and the vuln.today decision label is 'monitor' - both point away from urgency. There is no CISA KEV listing and no EPSS score was supplied, so there is no evidence of active or probable widespread exploitation (no public exploit identified as actively used at time of analysis; a public PoC reproducer is included in the GHSA advisory but is not verified as a weaponized working exploit). The 4.0 vector (AV:N/AC:H/AT:P/PR:L/UI:P/VC:L/VI:L/VA:N) encodes exactly why real risk is low despite network reach: high attack complexity, a present attack requirement, a privilege requirement, passive user interaction, and only Low confidentiality/integrity impact with no availability impact. The most important limiter is not captured well by the raw score and must be read from the advisory: exploitation requires an application to serialize a function whose source text is attacker-influenced (in practice via a spoofed toString()), which is an unusual precondition. Ordinary function values - which always end in '}' - and all non-function values including strings containing '</script' are escaped correctly and are not affected. This is therefore a real, verifiable defect worth patching on a normal maintenance cadence, not a high-CVSS-but-low-real-risk mismatch and not an emergency.

Exploit ScenarioDerived

An application using serialize-javascript < 7.1.3 serializes attacker-influenced data that includes a function whose spoofed toString() returns source ending in a bare '</script', while a later serialized value supplies the closing '>' plus injected markup such as '<img src=x onerror=alert(1)>'. When that serialized output is embedded inside an HTML <script> element and the victim loads the page, the script element terminates early at the injected tag and the markup becomes a live element, executing attacker script in the victim's browser. The GHSA advisory includes a concrete reproducer demonstrating this.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 23, 2026

Cross-site scripting in serialize-javascript before 7.1.3 lets an attacker who controls the source text of a serialized function (in practice via a spoofed toString()) break out of an HTML <script> element and introduce live markup, but only in a narrow configuration: the function body must end exactly at a bare '</script' with no trailing delimiter character, the surrounding serialized output must then supply the delimiter (for example the newline emitted by the 'space' pretty-print option), and a later serialized value must supply the closing '>' plus injected markup. The assessed vector is CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N, a scope-changing low-impact injection that requires a victim to load the affected page; ordinary functions (which end in '}') and non-function values, including strings containing '</script', are escaped correctly and are not affected. There is no CISA KEV entry and no confirmed active exploitation; a public reproducer is documented in the upstream advisory, and the vendor-released fix is version 7.1.3.

RemediationAI

Vendor-released patch: 7.1.3. Upgrade serialize-javascript to 7.1.3 or later (release tag https://github.com/yahoo/serialize-javascript/releases/tag/v7.1.3, implementing PR https://github.com/yahoo/serialize-javascript/pull/235, commit 2864b3c6260a3bfd52d2db3e70d1a079de108a61), which extends the close-tag lookahead to match a bare '</script' at end-of-string so it is escaped regardless of what follows in the output. The vendor states that upgrading to 7.1.3 is the only complete fix, and that if an upgrade is not possible the workaround is to avoid serializing function values whose source text or toString() can be influenced by an attacker - a restriction that removes the exploitable path at the cost of not being able to serialize attacker-influenced or custom-toString function values. Full details are in advisory GHSA-m5mm-p8h7-m29v.

Affected VersionsENISA

serialize-javascript < 7.1.3

Affected Packages

npm serialize-javascript fix: 7.1.3

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 library that serializes JavaScript values (including regular expressions and functions, a superset of JSON) for embedding inside an HTML <script> element, and it is expected to escape anything that could terminate that element. Its close-tag neutralization used the pattern /<\/script[^<>]*>|<\/script(?=[\t\n\f\r \/>])/gi, which catches a complete '</script ...>' sequence or a bare '</script' only when followed by a character the HTML tokenizer treats as ending the tag name (TAB, LF, FF, CR, SPACE, '/' or '>'). Because each function body is escaped independently, a body that ends exactly at '</script' has no following character to match, so it was emitted unescaped; the terminating delimiter is then contributed by surrounding serialized output and the closing '>' plus markup by a subsequent serialized value, and the HTML parser ends the script element at the injected tag. The root cause is CWE-79 (improper neutralization of input during web page generation), specifically an incomplete output-escaping context boundary. The CPE cpe:2.3:a:yahoo:serialize-javascript:*:*:*:*:*:*:*:* covers all releases before the fix, and the upstream patch (PR #235) changes the lookahead to /<\/script[^<>]*>|<\/script(?=$|[\t\n\f\r \/>])/gi so the bare form also matches at end-of-string. The CVE record carries a CVSS 4.0 vector (AV:N/AC:H/AT:P/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N, base score 2.1) and the independent assessment uses CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N; both agree the impact is limited and the practical precondition - attacker-influenced function source text - is restrictive.

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

Vendor (GitHub_M) PRIMARY 2.1 LOW
CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
vuln.today AI 4.7 MEDIUM

Exploitation needs a specific function-source precondition and surrounding-output cooperation (AC:H) and a victim page load (UI:R); XSS crosses into the browser (S:C) with only limited confidentiality/integrity impact and no availability impact.

3.1 AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
Low
User Interaction
Passive
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Oct 23, 2026 - 22:03 EUVD
CVE Published
Oct 23, 2026 - 21:37 cve.org
LOW 2.1

DescriptionCVE.org

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(). This issue is fixed in version 7.1.3.

Threat Intelligence Overview

EPSS Score
0.4%
Top 67% exploitable
Prevalence
High
extremely popular npm serialization library, very high weekly download volume
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High

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.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
High

Priority Score

10
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +10
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy