All reports
Medium

serialize-javascript: serialize-javascript: Cross-site scripting via unescaped function serialization

Affected versions

Affected versions
Unknown
Fixed version
Not reported

Exploitation

CVE-2026-115754

Probability of exploitation in the next 30 days: 0.23%

FIRST EPSS · 2026-11-22

Description

serialize-javascript from 7.0.1 before 7.1.3 contains a cross-site scripting vulnerability that allows attackers to break out of HTML script elements by ending serialized function source text with an unescaped </script. Attackers controlling a function's source via a spoofed toString() can combine surrounding output delimiters and later values to inject live markup such as img onerror handlers.

A flaw was found in serialize-javascript. This vulnerability allows an attacker to conduct cross-site scripting (XSS) attacks by supplying crafted function source text containing unescaped script closing tags. When serialized into a web page, the malicious payload can prematurely close the enclosing script element and execute arbitrary code in the context of the victim's browser session.