CVE-2025-57820: Devalue Devalue Prototype Pollution Vulnerability Vulnerability
HIGHCVE-2025-57820 is a HIGH devalue prototype pollution vulnerability vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Devalue libraries in the npm ecosystem. The issue involves devalue prototype pollution vulnerability. Remediation is available by upgrading affected packages to version 5.3.2.
CVE-2025-57820 at a Glance
How to Fix CVE-2025-57820
To remediate this vulnerability, upgrade all affected Devalue dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install devalue@5.3.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls devalue
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2025-57820, inspect your project dependencies using npm:
npm ls devalue
Analyze the terminal output to locate any version of Devalue in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.3.2), your application is affected.
Note: The npm ls devalue command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In Devalue, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-57820 Affected Devalue Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
devalue
|
npm |
< 5.3.2
|
5.3.2
|
References
Frequently Asked Questions
What is CVE-2025-57820?
Which Devalue versions are affected?
What version fixes CVE-2025-57820?
Is devalue affected?
What CWE is associated with CVE-2025-57820?
How can I check npm dependencies for CVE-2025-57820?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vj54-72f3-p5jv",
"modified" : "2025-08-27T14:27:08Z",
"published" : "2025-08-26T22:33:14Z",
"aliases" : [ "CVE-2025-57820" ],
"summary" : "devalue prototype pollution vulnerability",
"details" : "## 1. `devalue.parse` allows `__proto__` to be set\n\nA 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:\n\n```js\nclass Vector {\n constructor(x, y) {\n this.x = x;\n this.y = y;\n }\n\n get magnitude() {\n return (this.x ** 2 + this.y ** 2) ** 0.5;\n }\n}\n\nconst payload = `[{\"x\":1,\"y\":2,\"magnitude\":3,\"__proto__\":4},3,4,\"nope\",[\"Vector\",5],[6,7],8,9]`;\n\nconst vector = devalue.parse(payload, {\n Vector: ([x, y]) => new Vector(x, y)\n});\n\nconsole.log(\"Is vector\", vector instanceof Vector); // true\nconsole.log(vector.x) // 3\nconsole.log(vector.y) // 4\nconsole.log(vector.magnitude); // \"nope\" instead of 5\n```\n\n## 2. `devalue.parse` allows array prototype methods to be assigned to object\n\nIn a payload constructed with `devalue.stringify`, values are represented as array indices, where the array contains the 'hydrated' values:\n\n```js\ndevalue.stringify({ message: 'hello' }); // [{\"message\":1},\"hello\"]\n```\n\n`devalue.parse` does not check that an index is numeric, which means that it could assign an array prototype method to a property instead:\n\n```js\nconst object = devalue.parse('[{\"toString\":\"push\"}]');\nobject.toString(); // 0\n```\n\nThis could be used by a creative attacker to bypass server-side validation.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "devalue"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.3.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/sveltejs/devalue/security/advisories/GHSA-vj54-72f3-p5jv"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-57820"
}, {
"type" : "WEB",
"url" : "https://github.com/sveltejs/devalue/commit/0623a47c9555b639c03ff1baea82951b2d9d1132"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/sveltejs/devalue"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1321" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-08-26T22:33:14Z",
"nvd_published_at" : "2025-08-26T23:15:35Z"
}
}