CVE-2026-115897
Serialize JavaScript serializes JavaScript values to a superset of JSON that includes regular expressions and functions.
Impact
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.
Affected packages
| Ecosystem | Package | Affected | Fixed in |
|---|---|---|---|
| npm | serialize-javascript | < 7.1.3 | 7.1.3 |
Weakness classification
References
- NVD record
- CVE.org record
- GitHub advisory
- https://github.com/advisories/GHSA-m5mm-p8h7-m29v
- 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