# CVE-2026-97711: serialize-javascript XSS via script-closing tag bypass in functions

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

CVE-2026-97711 · Severity: medium · CVSS 4 · Published 2026-09-29

serialize-javascript is a Node.js library that converts JavaScript objects into serialized form. When serializing function values, the library failed to properly neutralize script-closing tags in function source code, allowing attackers to inject HTML and JavaScript that executes in the page origin. An attacker who controls a function passed to serialize-javascript can break out of the script element and execute arbitrary JavaScript in the page.

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-97711 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-97711 being exploited in the wild.

**How severe is CVE-2026-97711?** Medium severity, with a CVSS score of 4, published 29 September 2026.

**Which products and versions are affected?** serialize-javascript (npm) >= 7.1.1, < 7.1.2, SEMVER:introduced=7.1.1,fixed=7.1.2; Yahoo Serialize-Javascript 7.1.1 before 7.1.2.

**Is there a fix for CVE-2026-97711?** Yes. serialize-javascript (npm): upgrade to 7.1.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

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

**Am I affected by CVE-2026-97711?** 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

- serialize-javascript (npm): upgrade to 7.1.2 or later

  ```sh
  npm install serialize-javascript@7.1.2
  ```


## Technical details

The vulnerability is a cross-site scripting (XSS) flaw in the function serialization logic. The SCRIPT_CLOSE_REGEXP pattern could match across multiple script-closing tags, causing one tag to be consumed without proper escaping while a second tag survived verbatim. When the serialized output is embedded in an HTML script element, the surviving </script> tag prematurely closes the element, and the remaining payload is parsed as HTML. The vulnerability affects function values only and requires the attacker to supply a malicious function to the serialize() call; ordinary data values are unaffected. Fixed in version 7.1.2.

## Affected products

- Yahoo serialize-javascript 7.1.1 before 7.1.2

## Identifiers

- CVE-2026-97711
- GHSA-gfhx-hw2g-v5hg

## Timeline

- 2026-09-29: disclosed: CVE-2026-97711 published
- 2026-09-24: patched: Fix released in version 7.1.2

## References

- [https://github.com/yahoo/serialize-javascript/commit/2bdbaaff9cb8a4639135eb24cfcd383d3fefb534](https://github.com/yahoo/serialize-javascript/commit/2bdbaaff9cb8a4639135eb24cfcd383d3fefb534)
- [https://github.com/yahoo/serialize-javascript/releases/tag/v7.1.2](https://github.com/yahoo/serialize-javascript/releases/tag/v7.1.2)

## Related threats

- [Yahoo Serialize JavaScript XSS via unescaped script tag in function body](https://junglewise.ai/threats/cve-2026-115897-serialize-javascript-serializes-javascript-values-to-a-superset)
- [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)
- [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)
