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.

Project Subscriptions

Vendors Products
Serialize-javascript Subscribe
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
Fixes

Solution

No solution given by the vendor.


Workaround

No workaround given by the vendor.

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'}


Projects

Sign in to view the affected projects.

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