Summary
CVE-2026-59940 is a critical type confusion vulnerability in seroval, a JavaScript/TypeScript library used to serialize and deserialize complex values (including Promises) for transport between server and client, commonly used in server-side rendering and RPC frameworks. The flaw resides in seroval’s fromJSON() deserialization routine, where attacker-supplied JSON can manipulate internal Promise resolver mechanics and trigger unintended method invocation. The issue is rated CVSS 9.8 (Critical) and is remotely exploitable without authentication or user interaction.
Technical details
- Root cause: During deserialization, seroval’s Promise-handling logic reads values from a general internal deserialization reference table without first verifying that the referenced entry is a genuine internal Promise resolver record. This lack of validation allows attacker-controlled JSON to be treated as if it were trusted resolver state.
- Trigger conditions: Exploitation requires an application to deserialize untrusted/attacker-controlled JSON using seroval with plugins enabled, a common pattern in server frameworks that use seroval for serializing Promises/streaming data (e.g., SSR/RPC boundaries).
- Attack vector: Network-based; no privileges or user interaction required (
AV:N/AC:L/PR:N/UI:N). - Impact: Successful exploitation causes type confusion between attacker-supplied objects and internal Promise control structures, enabling unintended method invocation during deserialization. Depending on the functionality exposed by the consuming application, this can lead to arbitrary code execution and full compromise of confidentiality, integrity, and availability.
- Weakness classifications: CWE-502 (Deserialization of Untrusted Data), CWE-843 (Type Confusion / Access of Resource Using Incompatible Type).
Affected software
- seroval (npm package, by lxsmnsyc): all versions up to and including 1.5.2
- Fixed in version 1.5.3
- Any downstream framework or application bundling a vulnerable seroval version (e.g., server-side rendering/RPC tooling that relies on seroval for Promise serialization) inherits this exposure until seroval is upgraded.
Severity
- CVSS v3.1 Base Score: 9.8 (Critical)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Mitigation and recommended actions
- Immediate: Upgrade
serovalto version 1.5.3 or later in all applications and dependent frameworks. Auditpackage-lock.json/yarn.lock/pnpm-lock.yamlfor transitive dependencies pulling in a vulnerable seroval version and force resolution to a patched release. - If immediate patching is not possible:
- Avoid deserializing untrusted or externally supplied JSON through seroval’s
fromJSON()/plugin-enabled deserialization paths. - Restrict or disable seroval plugins that are not strictly required, particularly any that process external input.
- Apply network-level controls (WAF rules, input validation at the API boundary) to filter anomalous or malformed JSON payloads destined for endpoints that perform seroval deserialization.
- Monitor application logs for unexpected errors or anomalous behavior in server-side rendering/RPC endpoints that consume external JSON via seroval.
- Avoid deserializing untrusted or externally supplied JSON through seroval’s

