Sveltejs devalue prototype pollution in parse and unflatten

Severity: medium · CVSS 4 · Published 2026-03-12

Sveltejs devalue is a library used to serialize and deserialize JavaScript objects. The library's parse and unflatten functions can emit objects with `__proto__` properties, which can lead to prototype pollution when downstream code uses these objects unsafely (e.g., with Object.assign). While not a direct vulnerability in devalue itself, this behavior enables prototype pollution attacks if the deserialized data is mishandled by applications.

Technologies: devalue (npm). Vendors: npm.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Medium severity, with a CVSS score of 4, published 12 March 2026.
Which products and versions are affected?
devalue (npm) SEMVER:introduced=4.0.0,fixed=5.6.4.
Is there a fix for This vulnerability?
Yes. devalue (npm): upgrade to 5.6.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network, in a software library.
Am I affected?
Check whether you run devalue (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • devalue (npm): upgrade to 5.6.4 or later
    npm install devalue@5.6.4

Technical details

The vulnerability is a prototype pollution weakness (CWE-1321) in the devalue library's `parse` and `unflatten` functions. Under certain circumstances, these functions emit objects containing `__proto__` as an own property. Although JSON.parse exhibits the same behavior and `__proto__` own properties are not inherently dangerous, they become exploitable when downstream code incorrectly processes the deserialized objects—specifically when using Object.assign or similar patterns that can pollute the prototype chain. The vulnerability affects versions 4.0.0 through 5.6.3 and has been patched in version 5.6.4 with changes to disallow `__proto__` keys.

Affected products

  • Sveltejs devalue 4.0.0 to 5.6.3

Timeline

  • 2026-03-12: disclosed
  • 2026-03-12: patched: Fixed in version 5.6.4

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.