npm
CVE-2026-116582
Seroval: Script injection through RegExp sources in serialized output
- Severity
- Medium 4.7
- Published
- 28 Oct 2026
- Last changed
- 28 Oct 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 1.0.0, 1.6.10
- Exploit chance
- 0.2% in the next 30 daysHigher than 8% of CVEs. EPSS by FIRST, 24 Nov 2026
- Attack
- Over the network · Only under certain conditions · No login needed · Needs someone to click or open something
- Attacker can
- Read some data · Change some data
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N- Also known as
- GHSA-9wx9-5pv9-3349
- Sources
- OSV.dev and GitHub
Description
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 element that the serialized output is placed in, and run script in the page.
seroval escapes < in strings, so string values cannot end a 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.
An application is affected when all of these are true:
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 software
| Software | Affected versions |
|---|---|
serovalnpm · osv:npm:seroval |
|
About seroval
- Weekly downloads (npm)
- 42,273,924npm, 23 Nov 2026
Vulnerabilities in seroval
- In our list
- 5
- Published in the last 12 months
- 5
- Critical, last 12 months
- 0
- High, last 12 months
- 3
- Known exploited
- 0
- CVE-2026-116583Seroval: Code injection through a typed array's own constructor propertyMedium 28 Oct 2026
- CVE-2026-116581Seroval: fromJSON deserializer trusts node-supplied array length and sequence doneAt (unauthenticated event-loop DoS)High 7.5 28 Oct 2026
- CVE-2026-116584Seroval `fromJSON`/`fromCrossJSON` denial of service via unvalidated array node lengthHigh 7.5 28 Oct 2026
- CVE-2026-116580Seroval: Deserialization invokes attacker-chosen callables: AsyncIteratorFactoryInstance calls source.on(listener) without type checkHigh 7.3 28 Oct 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-116582
- GitHub Advisory Database https://github.com/advisories/GHSA-9wx9-5pv9-3349