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

Low 2.3 Published Updated

Attackers can execute arbitrary scripts in the victim's browser by injecting unescaped closing script tags into serialized function bodies.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-97711?

CVE-2026-97711 is a low-severity cross-site scripting vulnerability in yahoo serialize-javascript, published on 29 Sep 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

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

Weakness: CWE-79

Which versions are affected by CVE-2026-97711?

2 open source packages ship an affected version, including serialize-javascript.

PackageAffectedFixed in
serialize-javascript npmFrom 7.1.17.1.2
serialize-javascript npmFrom 7.1.17.1.2

How do I fix CVE-2026-97711?

Upgrade serialize-javascript to 7.1.2 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2026-97711 being exploited?

There is no known exploitation of CVE-2026-97711 in the wild and no public exploit code.

Sources

Also known as CLSA-2026-1790854792, DEBIAN-CVE-2026-97711, GHSA-gfhx-hw2g-v5hg, UBUNTU-CVE-2026-97711.

Is CVE-2026-97711 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free