# CVE-2026-115897: Yahoo Serialize JavaScript XSS via unescaped script tag in function body

Source: https://junglewise.ai/threats/cve-2026-115897-serialize-javascript-serializes-javascript-values-to-a-superset  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-23. Updated: 2026-10-23  
License: CC BY 4.0 with a link back

CVE-2026-115897 · Severity: low · Published 2026-10-23

Serialize JavaScript is a library that converts JavaScript objects into a serialized format for storage or transmission. The library failed to properly escape script tags when serializing function bodies, allowing an attacker to inject malicious HTML and JavaScript code into a web page by controlling function source text. This could lead to account takeover, data theft, or malware injection for users viewing affected pages.

Technologies: [serialize-javascript (npm)](https://junglewise.ai/threats/technologies/serialize-javascript), [Yahoo Serialize-Javascript](https://junglewise.ai/threats/technologies/yahoo-serialize-javascript). Vendors: [npm](https://junglewise.ai/threats/vendors/npm), [Yahoo](https://junglewise.ai/threats/vendors/yahoo).

## Quick answers

**Is CVE-2026-115897 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-115897 being exploited in the wild.

**How severe is CVE-2026-115897?** Low severity, published 23 October 2026.

**Which products and versions are affected?** serialize-javascript (npm) < 7.1.3; Yahoo Serialize-Javascript prior to 7.1.3.

**Is there a fix for CVE-2026-115897?** Yes: fixed in 7.1.3. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-115897 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-115897?** Check whether you run serialize-javascript (npm) or Yahoo Serialize-Javascript at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Fixed in 7.1.3

## Technical details

The vulnerability is a cross-site scripting (XSS) flaw in the `escapeFunctionBody()` function that fails to neutralize a closing `</script` tag appearing at the end of a function body. Since each function body is escaped independently, a bare `</script` prefix at the end of a function body followed by a delimiter (such as a newline from the `space` option) in surrounding output creates an HTML script injection vector. An attacker must control the serialized function's source text via a spoofed `toString()` method.

## Affected products

- Yahoo Serialize JavaScript prior to 7.1.3

## Identifiers

- CVE-2026-115897
- GHSA-m5mm-p8h7-m29v

## Timeline

- 2026-10-23: disclosed
- 2026-10-22: patched

## References

- [https://github.com/yahoo/serialize-javascript/commit/2864b3c6260a3bfd52d2db3e70d1a079de108a61](https://github.com/yahoo/serialize-javascript/commit/2864b3c6260a3bfd52d2db3e70d1a079de108a61)
- [https://github.com/yahoo/serialize-javascript/pull/235](https://github.com/yahoo/serialize-javascript/pull/235)

## Related threats

- [serialize-javascript cross-site scripting via unescaped script tag](https://junglewise.ai/threats/cve-2026-115754-serialize-javascript-from-7-0-1-before-7-1-3-contains-a-cross)
- [serialize-javascript XSS via script-closing tag bypass in functions](https://junglewise.ai/threats/cve-2026-97711-serialize-javascript-serializes-javascript-values-to-a-superset)
- [Yahoo serialize-javascript CPU exhaustion DoS via crafted array-like objects](https://junglewise.ai/threats/cve-2026-34043-yahoo-serialize-javascript-cpu-exhaustion-dos-via-crafted-array)
- [serialize-javascript code injection via RegExp.flags and Date.toISOString](https://junglewise.ai/threats/serialize-javascript-code-injection-via-regexp-flags-and-date-a4d4abae)
- [Yahoo serialize-javascript XSS in object serialization](https://junglewise.ai/threats/cve-2024-11831-yahoo-serialize-javascript-xss-in-object-serialization)
