All vulnerabilities

npm

CVE-2026-116583

Seroval: Code injection through a typed array's own constructor property

Severity
Medium
Published
28 Oct 2026
Last changed
28 Oct 2026
Added to UpHeron
23 Nov 2026
Fixed in
1.6.11
Exploit chance
0.4% in the next 30 daysHigher than 28% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Cross-site scripting (CWE-79)Code injection (CWE-94)
Also known as
GHSA-f86p-h4j2-7qgj
Sources
OSV.dev and GitHub

Description

seroval writes a typed array as a call to its constructor. In affected versions, the constructor name in the output is read from a property that data on the value can replace, and it is written without checks. A typed array that received properties from untrusted data can then put arbitrary code into the serialized output.

Version 1.6.0 changed how seroval finds the class of an object, so that objects with their own constructor property serialize correctly. Typed arrays still took the constructor name from the value itself, so the name could come from the untrusted property instead of the array's real type.

These functions are affected:

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

fromJSON and fromCrossJSON are not affected: they only accept the names of the built-in typed arrays. With the compactArrayBufferViews option, the same lookup throws a TypeError instead of writing code.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Workarounds

If you cannot upgrade, do not copy properties from untrusted objects onto typed arrays, or remove an own constructor property from a typed array before serializing it.

Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
serovalnpm · osv:npm:seroval
  • From 1.6.0 before 1.6.11

About seroval

Weekly downloads (npm)
42,273,924npm, 23 Nov 2026

References