CVE-2026-116582: Seroval: Script injection through RegExp sources in serialized output
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.
Published Oct 28, 2026
Affected packages
seroval
- Ecosystem
- npm
- Affected
- >= 1.5.5, < 1.6.10
- Fixed in
- 1.6.10
- Check
npm ls seroval
seroval
- Ecosystem
- npm
- Affected
- < 1.0.0
- Fixed in
- 1.0.0
- Check
npm ls seroval
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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
<inRegExpsources, so that named groups and lookbehinds keep working. This removed the escaping for every<in a source.
These functions are affected:
serialize,serializeAsynccrossSerialize,crossSerializeAsync,crossSerializeStream- the
Serializerclass 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:
- It builds a
RegExpfrom untrusted input that is used as regular expression syntax. Input passed through an escaping helper (such as anescapeRegExpfunction) is not enough to exploit this. - It serializes that
RegExpwith one of the functions above. - 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
RegExpbuilt from untrusted pattern syntax. Send its source and flags as strings, and build theRegExpon the client. - Or reject patterns that contain
<before they reach the serializer.
References
- https://github.com/lxsmnsyc/seroval/security/advisories/GHSA-9wx9-5pv9-3349
- https://nvd.nist.gov/vuln/detail/CVE-2026-116582
- https://github.com/lxsmnsyc/seroval/commit/f94ee0b63936dae954ff50d5b5e8ea7cb9b284e6
- https://github.com/lxsmnsyc/seroval/releases/tag/[email protected]
- https://github.com/advisories/GHSA-9wx9-5pv9-3349
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-116580
Seroval: Deserialization invokes attacker-chosen callables: AsyncIteratorFactoryInstance calls source.on(listener) without type check
high7.3Oct 28, 2026CVE-2026-116581
Seroval: fromJSON deserializer trusts node-supplied array length and sequence doneAt (unauthenticated event-loop DoS)
high7.5Oct 28, 2026CVE-2026-116583
Seroval: Code injection through a typed array's own constructor property
medium5.3Oct 28, 2026CVE-2026-116584
Seroval `fromJSON`/`fromCrossJSON` denial of service via unvalidated array node length
high7.5Oct 28, 2026CVE-2026-104845
Seroval: Memory exhaustion via unchecked TypedArray length in JSON deserialization
high7.5Oct 5, 2026CVE-2026-104846
Seroval: `fromJSON()` Promise thenable assimilation invokes plugin-produced callables (bypass of GHSA-mv8w-475r-vwqw)
critical9.8Oct 5, 2026
