---
id: "CVE-2026-115754"
kind: "vulnerability"
aliases: ["CVE-2026-115754"]
title: "serialize-javascript: unescaped script close tag enables XSS via function source"
severity: "medium"
cvss: 4.7
epss: 0.00322
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["javascript", "npm", "package", "server-rendering", "webpack"]
not_affected_if: ["no-function-serialization", "static-data-only"]
published_at: "2026-10-23T14:17:52+00:00"
first_seen_at: "2026-10-23T21:57:34+00:00"
updated_at: "2026-10-25T12:38:50+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-115754", "first_seen_at": "2026-10-23T21:57:34+00:00"}, {"source": "epss", "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-115754", "first_seen_at": "2026-10-25T12:38:50+00:00"}]
---

# serialize-javascript: unescaped script close tag enables XSS via function source

serialize-javascript versions 7.0.1 before 7.1.3 fail to escape the closing script tag inside serialized function source text. An attacker who controls a function's source through a spoofed toString() can break out of the HTML script element and inject live markup such as img onerror handlers.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Run `npm ls serialize-javascript` to find installed versions in the dependency tree.
- Check whether any installed version is `7.0.1` up to but not including `7.1.3`.

## Fix

- Upgrade serialize-javascript to `7.1.3` or later.
- Rebuild and redeploy any bundle that embeds serialized output.

## Timeline

- 2026-10-23T21:57:34+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-115754
- 2026-10-25T12:38:50+00:00 epss https://api.first.org/data/v1/epss?cve=CVE-2026-115754

## From the sources

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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
