Skip to main content
← All vulnerabilities
CVE-2026-115897EUVD-2026-109190GHSA-M5MM-P8H7-M29V

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

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 7.1.3
None on Exploit-DB, Metasploit or GitHub
  • Exploitation: none
  • Automatable: no
  • Technical impact: partial

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.

Summarized by anthropic/claude-haiku-5.5. Verify details against the original sources.

Read the original 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.

Timeline

  1. CVE published
  2. First seen by cve.now
  3. CISA SSVC assessment

    Exploitation: none · Automatable: no · Technical impact: partial

  4. Record last updated

Affected versions

  • yahoo serialize-javascript

    fixed in 7.1.3

  • serialize-javascriptnpm

    fixed in 7.1.3

References 4

GitHub · yahoo/serialize-javascript