Skip to main content

serialize-javascript EUVDEUVD-2026-89027

| CVE-2026-97711 LOW
Cross-site Scripting (XSS) (CWE-79)
2026-09-29 security-advisories@github.com GHSA-gfhx-hw2g-v5hg
2.3
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

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

  1. Access
    Influence serialized function source
  2. Delivery
    Server embeds output in script element
  3. Exploit
    Inner </script> survives regex escaping
  4. Execution
    Browser closes script early, parses HTML
  5. Impact
    Attacker JavaScript runs in page origin

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

Exploitation requires serialize-javascript 7.1.1 (fixed in 7.1.2) AND the consuming application must serialize a FUNCTION value whose source string is attacker-influenced AND embed that serialized output inside an HTML <script> element. Ordinary data values and options.isJSON output are NOT affected. The attacker must craft function source containing a </script in plain-code position (e.g. 'x</script=+/') followed later by a real </script> so a single SCRIPT_CLOSE_REGEXP match spans and swallows the inner closing tag. Limiting factors: only the 7.1.1 release is vulnerable, only function serialization is affected, victim page rendering (user interaction) is needed to trigger the injected markup, and the impact is XSS in the page origin rather than server compromise - no confidentiality/integrity/availability impact to the vulnerable system itself.

Impact

This is a genuine but low-severity, narrow-window XSS. The vendor CVSS 4.0 vector (AV:N/AC:L/AT:P/PR:N/UI:P) yields only 2.3 because the impact is confined to subsequent-system integrity/confidentiality (SC:L/SI:L, VC/VI/VA all N) and requires both an attack requirement (AT:P) and passive user interaction (UI:P). No EPSS score, KEV listing, or public exploit was provided; per the precision rules this is 'no public exploit identified at time of analysis' (the exploit-shaped strings in the diff are regression tests shipped with the fix, PSECBUGS-117112, not weaponized public POC - do not conflate them). The decisive limiting factor is that ONLY function values are affected: an application must serialize a function whose source is attacker-influenced AND embed that output inside a <script> element, and only serialize-javascript versions 7.1.1 through 7.1.1 (fixed 7.1.2) are vulnerable. That is a very narrow production pattern - most consumers serialize data, not attacker-controlled functions - so despite the product's enormous footprint this is a real-but-low priority. Signals are consistent: low CVSS, no exploitation evidence, and a tightly-scoped trigger all agree this is not an urgent, widespread threat.

Exploit ScenarioDerived

An application uses serialize-javascript 7.1.1 to embed a function whose source string is influenced by attacker input, and injects the result into an inline <script> block. The attacker crafts function source such as 'return x</script=+/ + "</script><img src=x onerror=alert(1)>"' so the flawed SCRIPT_CLOSE_REGEXP swallows the inner </script> in one match, leaving it un-escaped; when the page renders, the surviving tag closes the script early and the remaining bytes parse as HTML, running attacker script in the page origin. No public exploit is known, though the fix commit ships regression tests demonstrating the vector.

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

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

Alert me

AnalysisAIv1 – Sep 29, 2026

Cross-site scripting in serialize-javascript 7.1.1 arises because function values serialized by the library are not fully protected against script-closing tags: the SCRIPT_CLOSE_REGEXP escaping pattern can match across and swallow a second closing tag, so a surviving </script> terminates the embedding script element early and the remaining output is parsed as HTML in the page origin. Exploitation requires an application on the narrow vulnerable release to serialize a function value whose source is attacker-influenced and embed that output inside an HTML <script> element, and a victim must load the resulting page (user interaction); ordinary data values and options.isJSON output are unaffected. The flaw is fixed in 7.1.2, and no public exploit was identified at time of analysis.

RemediationAI

Vendor-released patch: upgrade to serialize-javascript 7.1.2 or later (for example, npm install serialize-javascript@7.1.2), which corrects the SCRIPT_CLOSE_REGEXP over-match as well as the related non-string Function.toString() handling; see the GitHub security advisory GHSA-gfhx-hw2g-v5hg, release v7.1.2, and commit 2bdbaaff9cb8a4639135eb24cfcd383d3fefb534. If immediate upgrading is not possible, avoid serializing function values whose source may be attacker-influenced on 7.1.1, and do not embed the library's output directly inside a <script> element on that version-serving the same data through options.isJSON as an application/json response, or placing it in a non-executable context, removes the injection vector (ordinary data values and isJSON output are unaffected by the bug, so this trade-off is narrow rather than a general workaround). Escaping the </script sequence at the point of embedding or enforcing a Content Security Policy that disallows inline script offers defense in depth but does not replace the patch.

Affected VersionsENISA

serialize-javascript 7.1.1, < 7.1.2

Affected Packages

npm serialize-javascript fix: 7.1.2

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 converts JavaScript values into a JS-literal superset of JSON that can include regular expressions and functions; to safely embed its output inside an HTML <script> element it neutralizes sequences the HTML tokenizer would treat as an end tag. Before 7.1.2 the escaping pattern was /<\/script[^>]*>|<\/script(?=[\t\n\f\r \/>])/gi, and the first alternative's [^>]* could run from one </script past a subsequent </script> up to any later >, so a single match contained two closing-tag candidates while only one replacement was emitted, leaving the inner </script> verbatim in the output (CWE-79, improper neutralization of script-related HTML tags in a web page). The fixing commit 2bdbaaff9cb8a4639135eb24cfcd383d3fefb534 restricts the first alternative to [^<>]*, and additionally makes the native-code detection regexp non-global to avoid lastIndex state leaking between function checks and adds a TypeError guard requiring Function.toString() to return a string, closing related paths where a spoofed toString() could return an object whose replace() bypassed escaping. Only function serialization passes through this escaping logic; ordinary data values and options.isJSON output were never affected, and the resulting impact is JavaScript execution in the origin of the page that embeds the serialized value rather than any compromise of the vulnerable library host.

Know when 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) PRIMARY 2.3 LOW
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
vuln.today AI 4.7 MEDIUM

AC:H because the attacker must control the serialized function source and its embedding into a script element; S:C and C:L/I:L for stored/reflected XSS crossing into the page origin; A:N.

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

Primary rating from Vendor (github).

CVSS VectorVendor: github

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

Lifecycle Timeline

2
Patch available
Sep 29, 2026 - 17:17 EUVD
CVE Published
Sep 29, 2026 - 16:17 cve.org
LOW 2.3

DescriptionCVE.org

Serialize JavaScript serializes JavaScript values to a superset of JSON that includes regular expressions and functions. From 7.1.1 until 7.1.2, function values serialized by serialize-javascript are not fully protected against script-closing tags in attacker-influenced function source because SCRIPT_CLOSE_REGEXP can consume a second closing tag inside one match. When the serialized function is embedded in a script element, the surviving closing tag terminates the element early and causes the remaining output to be parsed as HTML, enabling cross-site scripting in the page origin. Only function values are affected; ordinary data values and options.isJSON output are unaffected. This issue is fixed in version 7.1.2.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 8 npm packages depend on serialize-javascript (7 direct, 1 indirect)

Ecosystem-wide dependent count for version 7.1.1.

Threat Intelligence Overview

EPSS Score
0.3%
Top 79% exploitable
Prevalence
Ubiquitous
core JS serializer, transitive dependency of webpack/terser build tooling
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub

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 Yes
EPSS 0.3%
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
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

32
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +12
PoC: +20
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.

CVE-2026-102827 CRITICAL POC
9.8 Sep 29

Command injection in simple-git, the Node.js library for running git commands and published on npm, affects all releases

CVE-2026-77615 HIGH POC
8.7 Sep 17

Stored DOM-based cross-site scripting in Paella Player's closed-caption rendering path (paella-core before 2.12.11) allo

CVE-2026-92776 HIGH POC
8.6 Sep 16

Authorization bypass in Wiki.js through 2.5.314 allows an authenticated user who has been granted access to at least one

CVE-2026-102826 HIGH POC
8.1 Sep 29

Untrusted git configuration includes reachable through simple-git before 4.0.0 let an attacker execute arbitrary command

CVE-2026-85715 HIGH POC
7.5 Sep 17

Improper memory allocation control in ExifReader before 4.41.1 allows remote attackers to exhaust heap memory and termin

CVE-2026-102278 HIGH POC
7.5 Sep 28

Deeply nested brace patterns cause unbounded recursion in the npm brace-expansion library, exhausting the native stack a

CVE-2026-102276 HIGH POC
7.5 Sep 28

Stack exhaustion in the npm library brace-expansion (all versions prior to 1.1.19, 2.1.5, 3.0.7, and 5.0.10) lets a craf

CVE-2026-92775 HIGH POC
7.1 Sep 16

Server-side request forgery in Wiki.js through 2.5.314 lets an authenticated user who holds page-editing permissions for

CVE-2026-101910 MEDIUM POC
6.9 Sep 28

The JavaScript library ip-address (npm) fails to treat the NAT64 local-use prefix 64:ff9b:1::/48 as private, so applicat

CVE-2026-101914 MEDIUM POC
6.5 Sep 28

Authorization bypass in the @grpc/grpc-js-xds package (the xDS/RBAC extension for @grpc/grpc-js) lets a request for one

CVE-2026-101912 MEDIUM POC
6.3 Sep 28

Cross-family subnet comparisons in the ip-address npm library (all versions before 10.7.1) can cause isInSubnet and isHo

CVE-2026-101911 MEDIUM POC
6.3 Sep 28

Denial of service in the ip-address JavaScript/npm library (all versions prior to 10.7.1) lets remote attackers stall or

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