CVE-2026-97711: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in yahoo serialize-javascript
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.
AI Analysis
Technical Summary
The serialize-javascript package serializes JavaScript values to a JSON superset including functions and regular expressions. In versions >=7.1.1 and <7.1.2, function serialization is vulnerable because the regular expression SCRIPT_CLOSE_REGEXP can consume a second closing script tag inside one match. This causes the serialized function, when embedded in a script element, to terminate the script early and parse the remaining output as HTML, enabling cross-site scripting attacks. Only function values are affected; other data types and JSON outputs are safe. The issue is resolved in version 7.1.2.
Potential Impact
An attacker able to influence function source code serialized by serialize-javascript in affected versions can inject script-closing tags that break out of the script context and execute arbitrary HTML/JavaScript in the page origin. This can lead to cross-site scripting attacks. However, the CVSS score is low (2.3), indicating limited impact or exploitability. Ordinary data serialization is not impacted.
Mitigation Recommendations
Upgrade serialize-javascript to version 7.1.2 or later, where the vulnerability is fixed. No other mitigation is required as the issue only affects function serialization and is resolved in the official patch.
CVE-2026-97711: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in yahoo serialize-javascript
Description
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.
CVSS v4.0
Score 2.3low
Affected software
yahoo
serialize-javascript
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The serialize-javascript package serializes JavaScript values to a JSON superset including functions and regular expressions. In versions >=7.1.1 and <7.1.2, function serialization is vulnerable because the regular expression SCRIPT_CLOSE_REGEXP can consume a second closing script tag inside one match. This causes the serialized function, when embedded in a script element, to terminate the script early and parse the remaining output as HTML, enabling cross-site scripting attacks. Only function values are affected; other data types and JSON outputs are safe. The issue is resolved in version 7.1.2.
Potential Impact
An attacker able to influence function source code serialized by serialize-javascript in affected versions can inject script-closing tags that break out of the script context and execute arbitrary HTML/JavaScript in the page origin. This can lead to cross-site scripting attacks. However, the CVSS score is low (2.3), indicating limited impact or exploitability. Ordinary data serialization is not impacted.
Mitigation Recommendations
Upgrade serialize-javascript to version 7.1.2 or later, where the vulnerability is fixed. No other mitigation is required as the issue only affects function serialization and is resolved in the official patch.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-09-24T21:43:37.210Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6abbe18df7a7c541069b98cf
Added to database: 09/29/2026, 16:04:29 UTC
Last enriched: 09/29/2026, 16:17:46 UTC
Last updated: 09/29/2026, 17:09:08 UTC
Views: 15
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.