Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
MEDIUM severity

CVE-2026-116582 — seroval

MEDIUMFix: lxsmnsyc/seroval@f94ee0b

CVE-2026-116582 is a medium-severity (CVSS 4.7) Cross-site Scripting (XSS) vulnerability in seroval. A fix is available for seroval — see the affected versions and patch details below.

Seroval: Script injection through RegExp sources in serialized output

Also known asGHSA-9wx9-5pv9-3349
Published
Updated
Affected
2 pkgs
Patched
2 / 2
Exploits
None indexed
Exploitation data as of Oct 29, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

EPSS Exploitation Probability

via FIRST.org ↗
0.2%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs8th percentile — riskier than 8% of all scored CVEsHighest risk

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

CVE-2026-116582 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 397,508 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

2 pkgs affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

67other npm packages depend on this — each one inherits the vulnerability until it's patched upstream
serovalnpm
27.5Mdownloads / week

Description

Summary

seroval writes a RegExp as a regular expression literal. In affected versions, the < character in a RegExp source is written without escaping. A source built from untrusted input can then end the HTML <script> element that the serialized output is placed in, and run script in the page.

Details

seroval escapes < in strings, so string values cannot end a <script> 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 < in RegExp sources, so that named groups and lookbehinds keep working. This removed the escaping for every < in a source.

These functions are affected:

  • serialize, serializeAsync
  • crossSerialize, crossSerializeAsync, crossSerializeStream
  • the Serializer class
  • compileJSON

toJSON, fromJSON, toCrossJSON and fromCrossJSON are not affected, because they never produce JavaScript.

Impact

An application is affected when all of these are true:

  1. It builds a RegExp from untrusted input that is used as regular expression syntax. Input passed through an escaping helper (such as an escapeRegExp function) is not enough to exploit this.
  2. It serializes that RegExp with one of the functions above.
  3. It places the output inside an HTML <script> 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.

Affected Packages

2 total 2 fixed
EcosystemPackageVulnerable rangeFix
📦npmseroval≥ 1.5.5&&< 1.6.101.6.10npm install seroval@1.6.10
📦npmserovalall versions1.0.0npm install seroval@1.0.0

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for seroval, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update seroval to 1.6.10 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-116582 is resolved across your whole dependency graph.

  3. Workarounds

    Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.

Frequently Asked Questions

### Summary seroval writes a `RegExp` as a regular expression literal. In affected versions, the `<` character in a `RegExp` source is written without escaping. A source built from untrusted input can then end the HTML `<script>` element that the serialized output is placed in, and run script in the page. ### Details seroval escapes `<` in strings, so string values cannot end a `<script>` 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 `<` in `RegExp` sources, so that named groups and lookbehinds keep
O3 Security · Impact-Aware SCA

Is CVE-2026-116582 in your dependencies?

Find it across npm, including transitive dependencies.

CVE-2026-116582: seroval — Fixed in 1.6.10