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.
Published: 2026-09-29
Score: 2.3 Low
EPSS: < 1% Very Low
KEV: No
Impact: Cross-site scripting
Action: Patch
AI Analysis

Impact

Serialize JavaScript serializes values to a superset of JSON that includes function literals. An attacker can supply function source containing an unescaped closing script tag, which is not fully shielded by the library’s closing‑tag regex. When the serialized function is embedded directly inside a <script> element in a web page, the stray </script> prematurely terminates the element and the remaining text is parsed as HTML, allowing an attacker to inject arbitrary script content. Only function values are affected; ordinary data values and JSON‑only output are not impacted.

Affected Systems

The flaw exists in Yahoo's serialize‑javascript library, specifically in version 7.1.1. Releases from 7.1.1 up to, but not including, 7.1.2 are vulnerable, and the issue is fixed in 7.1.2.

Risk and Exploitability

The CVSS score is 2.3, indicating a low severity against confidentiality, integrity, and availability. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog. Exploitation requires that a web application embed the serialized function output directly into a <script> tag without proper escaping. The attack, therefore, depends on client‑side rendering code that trusts untrusted function bodies and is limited to scripts that run in the originating page context.

Generated by OpenCVE AI on September 30, 2026 at 00:53 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade serialize‑javascript to version 7.1.2 or later.
  • Audit all code paths that output serialized function bodies into <script> elements and ensure that the output is properly escaped or that function literals are not inserted directly.
  • If upgrading is not immediately possible, remove the use of function literals in serialized output or restrict the data to JSON‑only output, and apply sanitization to any dynamic content that may contain script tags.

Generated by OpenCVE AI on September 30, 2026 at 00:53 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-gfhx-hw2g-v5hg Serialize JavaScript: Cross-site scripting (XSS) via unescaped </script> in serialized function bodies
History

Wed, 30 Sep 2026 00:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'}

threat_severity

Moderate


Tue, 29 Sep 2026 18:15:00 +0000

Type Values Removed Values Added
First Time appeared Yahoo
Yahoo serialize-javascript
Vendors & Products Yahoo
Yahoo serialize-javascript

Tue, 29 Sep 2026 17:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 29 Sep 2026 16:15:00 +0000

Type Values Removed Values Added
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.
Title Serialize JavaScript: Cross-site scripting (XSS) via unescaped </script> in serialized function bodies
Weaknesses CWE-79
References
Metrics cvssV4_0

{'score': 2.3, 'vector': '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'}


Subscriptions

Yahoo Serialize-javascript
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-09-29T16:53:35.013Z

Reserved: 2026-09-24T21:43:37.210Z

Link: CVE-2026-97711

cve-icon Vulnrichment

Updated: 2026-09-29T16:53:30.489Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-09-29T16:17:19.000

Modified: 2026-09-30T19:38:27.293

Link: CVE-2026-97711

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-09-29T16:00:33Z

Links: CVE-2026-97711 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-09-30T01:00:09Z

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')