{"id":"CVE-2026-116582","aliases":["GHSA-9wx9-5pv9-3349"],"title":"Seroval: Script injection through RegExp sources in serialized output","titleSource":"GitHub_M","descriptionSource":"OSV","declaredSeverity":"MODERATE","description":"### Summary\n\nseroval 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.\n\n### Details\n\nseroval escapes `<` in strings, so string values cannot end a `<script>` element. `RegExp` sources did not get the same escaping:\n\n- Versions before 1.0.0 wrote the source as is.\n- 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.\n\nThese functions are affected:\n\n- `serialize`, `serializeAsync`\n- `crossSerialize`, `crossSerializeAsync`, `crossSerializeStream`\n- the `Serializer` class\n- `compileJSON`\n\n`toJSON`, `fromJSON`, `toCrossJSON` and `fromCrossJSON` are not affected, because they never produce JavaScript.\n\n### Impact\n\nAn application is affected when all of these are true:\n\n1. 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.\n2. It serializes that `RegExp` with one of the functions above.\n3. It places the output inside an HTML `<script>` element, as server rendering usually does.\n\nIn that case an attacker can run script in the page of any user who receives that output.\n\n### Patches\n\nFixed 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.\n\n### Workarounds\n\nIf you cannot upgrade:\n\n- Do not serialize a `RegExp` built from untrusted pattern syntax. Send its source and flags as strings, and build the `RegExp` on the client.\n- Or reject patterns that contain `<` before they reach the serializer.","severity":"medium","score":4.7,"published":"2026-10-26T20:46:46.069Z","modified":"2026-10-28T21:30:04.992Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"npm","name":"seroval","sources":[{"name":"OSV · GHSA-9wx9-5pv9-3349","url":"https://osv.dev/vulnerability/GHSA-9wx9-5pv9-3349"}],"ranges":[{"events":[{"introduced":"1.5.5"},{"fixed":"1.6.10"}],"type":"SEMVER"}],"versions":[],"fixed":["1.6.10"]},{"ecosystem":"npm","name":"seroval","sources":[{"name":"OSV · GHSA-9wx9-5pv9-3349","url":"https://osv.dev/vulnerability/GHSA-9wx9-5pv9-3349"}],"ranges":[{"events":[{"introduced":"0"},{"fixed":"1.0.0"}],"type":"SEMVER"}],"versions":[],"fixed":["1.0.0"]}],"sourceAffected":[],"references":["https://github.com/lxsmnsyc/seroval/security/advisories/GHSA-9wx9-5pv9-3349","https://github.com/lxsmnsyc/seroval/commit/f94ee0b63936dae954ff50d5b5e8ea7cb9b284e6","https://github.com/lxsmnsyc/seroval/releases/tag/seroval@1.6.10","https://nvd.nist.gov/vuln/detail/CVE-2026-116582","https://github.com/lxsmnsyc/seroval"],"sources":[{"name":"CVE","id":"CVE-2026-116582","modified":"2026-10-26T20:46:46.069Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-116582"},{"name":"OSV","id":"GHSA-9wx9-5pv9-3349","modified":"2026-10-28T21:30:04.992414732Z","url":"https://osv.dev/vulnerability/GHSA-9wx9-5pv9-3349"}],"assessments":[{"source":"GitHub_M","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","score":4.7},{"source":"OSV","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","score":4.7}],"products":[{"vendor":"lxsmnsyc","name":"seroval","platforms":[],"versions":[{"version":"< 1.0.0","status":"affected"},{"version":">= 1.5.5, < 1.6.10","status":"affected"}],"source":"GitHub_M","url":"https://www.cve.org/CVERecord?id=CVE-2026-116582"}],"remediation":[],"kev":{"status":"not-listed","checkedAt":"2026-10-29T03:10:35.950Z"},"coverage":[{"source":"NVD","status":"available","checkedAt":"2026-10-28T22:35:36.082Z","attemptedAt":"2026-10-28T22:35:36.082Z"},{"source":"GHSA","status":"available","checkedAt":"2026-10-28T22:35:36.276Z","attemptedAt":"2026-10-28T22:35:36.276Z"},{"source":"EUVD","status":"available","checkedAt":"2026-10-28T22:35:36.649Z","attemptedAt":"2026-10-28T22:35:36.649Z"},{"source":"EPSS","status":"available","checkedAt":"2026-10-28T22:35:36.032Z","attemptedAt":"2026-10-28T22:35:36.032Z"}],"evidence":[{"source":"FIRST EPSS","id":"CVE-2026-116582","url":"https://www.first.org/epss/","probability":0.00188,"percentile":0.08357,"date":"2026-10-28","checkedAt":"2026-10-28T22:35:36.032Z"},{"source":"NVD","id":"CVE-2026-116582","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-116582","modified":"2026-10-26T21:18:16.613","score":4.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","checkedAt":"2026-10-28T22:35:36.082Z"},{"source":"GitHub Advisory Database","id":"GHSA-9wx9-5pv9-3349","url":"https://github.com/advisories/GHSA-9wx9-5pv9-3349","modified":"2026-10-28T21:17:32Z","score":4.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","checkedAt":"2026-10-28T22:35:36.276Z"},{"source":"ENISA EUVD","id":"EUVD-2026-110449","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-110449","modified":"Oct 28, 2026, 9:17:31 PM","score":4.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","checkedAt":"2026-10-28T22:35:36.649Z"}]}