CVE-2026-97711
Received Received - Intake

serialize-javascript Function Source XSS via Script Closing Tag

Vulnerability report for CVE-2026-97711, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-09-29

Last updated on: 2026-09-29

Assigner: GitHub, Inc.

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 Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-09-29
Last Modified
2026-09-29
Generated
2026-09-29
AI Q&A
2026-09-29
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 4 associated CPEs
Vendor Product Version / Range
serialize-javascript serialize_javascript From 7.1.1 (inc) to 7.1.2 (exc)
serialize-javascript serialize_javascript 7.1.2
yahoo serialize-javascript From 7.1.1 (inc) to 7.1.2 (exc)
yahoo serialize-javascript 7.1.2

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability affects the serialize-javascript npm package version 7.1.1. It allows cross-site scripting (XSS) due to unescaped </script> tags in serialized function bodies. The issue occurs because the package fails to properly escape function values, letting crafted functions include unescaped </script> tags that prematurely end script elements in HTML. This enables the remaining content to be parsed as HTML, executing malicious scripts in the page's origin.

Detection Guidance

Check if your system uses serialize-javascript version 7.1.1 by running: npm list serialize-javascript. If version 7.1.1 is installed, the system is vulnerable. Inspect serialized function outputs for unescaped </script> tags in HTML responses.

Impact Analysis

If you use serialize-javascript version 7.1.1 and serialize functions with attacker-controlled source text, an attacker could inject malicious scripts. When the serialized output is embedded in a webpage, the injected script could execute in the context of your site, stealing data, performing actions on behalf of users, or defacing the page. This only affects function serialization, not regular data.

Compliance Impact

This XSS vulnerability could lead to unauthorized data access or modification, violating GDPR's integrity and confidentiality principles or HIPAA's safeguards for protected health information. A successful exploit may expose sensitive user data, resulting in compliance breaches, regulatory fines, or reputational damage.

Mitigation Strategies

Upgrade serialize-javascript to version 7.1.2 or later using: npm update serialize-javascript. Avoid serializing functions with untrusted source text to prevent XSS risks.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-97711. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart