Vulnerability DatabaseCVE-2026-115897

CVE-2026-115897: 
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-115897 is a Cross-Site Scripting (XSS) vulnerability in Yahoo's serialize-javascript npm package, caused by incomplete escaping of the </script prefix at the end of serialized function bodies. All versions prior to 7.1.3 are affected. The vulnerability was disclosed on October 23, 2026, with a fix released in version 7.1.3. It carries a CVSS v3.1 base score of 4.4 (Medium) and a CVSS v4.0 base score of 2.1 (Low) (Github Advisory, Feedly).

Technical details

The root cause is CWE-79 (Improper Neutralization of Input During Web Page Generation), specifically in the function-source escaping logic of serialize-javascript (Github Advisory). Because each function body is escaped independently, the library failed to neutralize a bare </script sequence when it appeared exactly at the end of a serialized function's source text — a condition that cannot arise with real JavaScript functions (which always end in }) but can be triggered via a spoofed toString() method. When the serialized output is embedded in an HTML <script> element, the injected </script prefix terminates the script block, and a subsequent serialized value can supply arbitrary HTML markup (e.g., <img onerror=...>) that becomes a live element in the page. The fix in PR #235 updated the SCRIPT_CLOSE_REGEXP to also match </script at the end of a string, ensuring it is unicode-escaped (GitHub PR #235, GitHub Commit).

Impact

Successful exploitation allows an attacker to inject and execute arbitrary JavaScript in the context of a victim's browser session on pages that embed serialized output, enabling session hijacking, credential theft, malware distribution, or unauthorized modification of page content (Github Advisory, Feedly). The confidentiality and integrity impacts are both rated Low, with no availability impact, reflecting the constrained exploitation conditions. The changed scope means the impact extends beyond the vulnerable component to the user's browser environment.

Exploitability

There is no public proof-of-concept exploit and no evidence of in-the-wild exploitation as of the disclosure date (Feedly). Exploitation requires the attacker to control the source text of a serialized function — in practice, through a spoofed toString() method — which is a non-trivial precondition that significantly limits the attack surface. The EPSS score is 0.0, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Ordinary function values and non-function values are not affected by this flaw.

Exploitation steps

  1. Identify a target application that uses serialize-javascript < 7.1.3 to serialize JavaScript objects (including functions) into HTML <script> blocks server-side.
  2. Gain influence over a serialized function's source text — the primary vector is supplying an object with a spoofed toString() method that returns a crafted string ending in </script (e.g., f.toString = () => 'function f(){ return 1 }// </script').
  3. Craft the payload: Ensure the spoofed toString() output ends exactly with the bare </script prefix, so the library's per-body escaping does not neutralize it. A subsequent serialized value in the same output provides the closing > and injected markup (e.g., <img src=x onerror=alert(1)>).
  4. Trigger serialization: Cause the server to serialize the attacker-influenced object and embed the result in an HTML page's <script> block.
  5. Victim visits the page: The browser parses the injected </script> as closing the script element, then renders the attacker-supplied HTML as a live DOM element, executing the injected JavaScript in the victim's browser context (Github Advisory, GitHub Commit).

Indicators of compromise

  • Logs: Server-side logs showing objects with unusual or externally-influenced toString() overrides being passed to serialize-javascript; application errors or unexpected output in serialized JavaScript blocks embedded in HTML responses.
  • Network: HTTP responses containing </script sequences within <script> block content that are not properly unicode-escaped; unexpected <img>, <iframe>, or other HTML tags appearing after a <script> block in page source.
  • File System: Unexpected modifications to server-side JavaScript files that introduce spoofed toString() methods on objects passed to serialization functions.
  • Browser/Client: Client-side JavaScript errors or unexpected network requests (e.g., to attacker-controlled domains) originating from pages that embed server-side serialized JavaScript (Github Advisory).

Mitigation and workarounds

Upgrade serialize-javascript to version 7.1.3 or later, which fixes the escaping logic to neutralize </script at the end of function bodies (GitHub Release v7.1.3). As a defense-in-depth measure, implement a strict Content Security Policy (CSP) to limit the impact of any injected scripts, and validate or restrict all sources of data passed to serialization functions to prevent untrusted input from reaching serialize-javascript. Avoid passing objects with externally-controlled toString() methods to the serializer.

Community reactions

The vulnerability was assigned and published via the GitHub Advisory Database (GHSA-m5mm-p8h7-m29v) and picked up by Red Hat's Bugzilla and security advisory feeds shortly after disclosure (Github Advisory, Red Hat Bugzilla). The issue was also noted on the InfoSec Exchange Mastodon instance and tracked by vulnerability aggregators including VulnDB, CVEFeed, and Tenable's cloud security plugins. Community reaction has been measured given the constrained exploitation preconditions, with no significant controversy or widespread alarm observed.

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

RHEL / CentOS

Unknown

Source: This report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-966w-4vpf-p7hcHIGH7.1
  • JavaScript logoJavaScript
  • @aloma.io/aloma
NoYesOct 25, 2026
GHSA-mrwp-f3q8-3g9pMEDIUM5.9
  • JavaScript logoJavaScript
  • follow-redirects
NoYesOct 25, 2026
GHSA-hfm3-x63j-7fxpHIGHN/A
  • JavaScript logoJavaScript
  • @payload-auth-link/migrate
NoYesOct 25, 2026
GHSA-6244-vvv9-76f5MEDIUMN/A
  • JavaScript logoJavaScript
  • @payload-auth-link/plugin
NoYesOct 25, 2026
GHSA-q53q-qg98-p9jfHIGHN/A
  • JavaScript logoJavaScript
  • llm-fw
NoYesOct 25, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management