CVE-2026-115897

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

Published Oct 23, 2026 CVSS 4.0 · 2.1 Low EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

Serialize JavaScript allows functions to be serialized into a superset of JSON that supports functions and regexes. In versions prior to 7.1.3 the serialization logic fails to escape a match of the literal string "</script" when it appears at the end of the function source. Because each function body is escaped independently, a serializing context that surrounds the function with a closing </script> tag can prematurely terminate the host script element. A subsequent serialized value containing attacker‑controlled markup then becomes part of the rendered page. The vulnerability enables the injection of arbitrary HTML and JavaScript into web pages, giving an attacker the ability to perform standard cross‑site scripting attacks such as defacement, cookie theft, and session hijacking.

Affected Systems

The Yahoo serialize-javascript library is affected. All releases prior to version 7.1.3 contain the flaw; updating to v7.1.3 or later removes the issue.

Risk and Exploitability

The CVSS score is 2.1, indicating low severity. No EPSS value is available and the vulnerability is not listed in the CISA KEV catalog. Exploitation requires that the attacker can influence the source code of a function that is later serialized, such as by providing a spoofed toString implementation. If the serialized output is embedded directly into a web page, the parameterized </script> sequence can break out of the script element and inject controlled markup. While the likelihood of exploitation appears limited, the impact of successful XSS remains non‑trivial.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade serialize-javascript to version 7.1.3 or later.
  • Ensure that any serialized functions are only used in contexts that do not directly inject into HTML or script tags; otherwise use encoding or string escaping.
  • If an immediate upgrade is not possible, audit code to confirm that no attacker‑controlled function source can be passed to serialize and sanitize any such input before serialization.

Generated by OpenCVE AI on October 23, 2026 at 22:21 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-m5mm-p8h7-m29v Serialize JavaScript: Cross-site scripting (XSS) via unescaped </script at the end of a serialized function body
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 4.4, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
First Time appeared Yahoo
Yahoo serialize-javascript
Vendors & Products Yahoo
Yahoo serialize-javascript
Type Values Removed Values Added
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.
Title Serialize JavaScript: Cross-site scripting (XSS) via unescaped </script at the end of a serialized function body
Weaknesses CWE-79
References
Metrics cvssV4_0

{'score': 2.1, 'vector': 'CVSS:4.0/AV:N/AC:H/AT:P/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Oct 26, 2026, 5:41 PM
Reserved
Oct 23, 2026, 7:37 PM
Status
Awaiting Analysis
Published
Oct 23, 2026, 10:16 PM
Modified
Oct 26, 2026, 6:39 PM
Severity
Moderate
Public date
Oct 23, 2026, 9:37 PM