CVE-2026-116582: Seroval: Script injection through RegExp sources in serialized output
Seroval facilitates JavaScript value stringification, including complex structures beyond JSON.stringify capabilities. Prior to 1.0.0 and from 1.5.5 until 1.6.10, the JavaScript-output APIs serialize a RegExp source containing a less-than character without the escaping needed for an HTML script element. An application is affected when it builds regular expression syntax from untrusted input, serializes that RegExp through serialize, serializeAsync, crossSerialize, crossSerializeAsync, crossSerializeStream, Serializer, or compileJSON, and embeds the result in an HTML script element. The crafted source can terminate the element and execute script in the page received by another user. This issue is fixed in version 1.6.10.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/serovalto a version that resolves this vulnerability.Fixed in 1.0.0 - Upgrade
Upgrade
npm/serovalto a version that resolves this vulnerability.Fixed in 1.6.10 - Upgrade
Upgrade
Serovalto a version that resolves this vulnerability.Fixed in 1.6.10 - Compensating control
Do not serialize a RegExp built from untrusted pattern syntax through serialize, serializeAsync, crossSerialize, crossSerializeAsync, crossSerializeStream, Serializer, or compileJSON.
- Compensating control
Reject regular-expression patterns containing '<' before they reach the serializer.
- Compensating control
Send the RegExp source and flags as strings and build the RegExp on the client instead of serializing the RegExp.