GitHub Advisoryadvisory · npm

GHSA-9wx9-5pv9-3349 Seroval: Script injection through RegExp sources in serialized output

MEDIUM Published 2026-10-28 Modified 2026-10-28 Official page ↗
Aliases
CVE-2026-116582
Ecosystem
npm
Packages
seroval
Severity
Moderate
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
Weaknesses
CWE-116, CWE-79
Reviewed
2026-10-28

Affected packages

• npm seroval: >= 1.5.5, < 1.6.10 → fixed in 1.6.10 • npm seroval: < 1.0.0 → fixed in 1.0.0

Description

Summary seroval writes a `RegExp` as a regular expression literal. In affected versions, the `` element that the serialized output is placed in, and run script in the page. Details seroval escapes `` element. `RegExp` sources did not get the same escaping: • Versions before 1.0.0 wrote the source as is. • Version 1.5.5 stopped escaping `` element, as server rendering usually does. In that case an attacker can run script in the page of any user who receives that output. Patches Fixed in 1.6.10. A `RegExp` whose source contains `<` is now written with the `RegExp` constructor and an escaped string source. Named groups and lookbehinds keep working. Workarounds If you cannot upgrade: • Do not serialize a `RegExp` built from untrusted pattern syntax. Send its source and flags as strings, and build the `RegExp` on the client. • Or reject patterns that contain `<` before they reach the serializer.

Related

Alias · CVE (1)

  • CVE-2026-116582 Seroval facilitates JavaScript value stringification, including complex structures beyond JSON.stringify capabilities. vulnerability

Weakness · CWE (2)

  • CWE-116 Improper Encoding or Escaping of Output weakness
  • CWE-79 Improper Neutralization of Input During Web Page Generation weakness

References