{"id":"CVE-2025-57820","aliases":["CVE-2025-57820","GHSA-vj54-72f3-p5jv"],"related":[],"kind":"vulnerability","state":"published","title":"Svelte devalue vulnerable to prototype pollution","summary":"Svelte devalue is a utility library. Prior to version 5.3.2, a string passed to devalue.parse could represent an object with a __proto__ property and devalue.parse does not check that an index is numeric. This could result in assigning prototypes to objects and properties, leading to prototype pollution. This issue has been fixed in version 5.3.2","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Svelte devalue is a utility library. Prior to version 5.3.2, a string passed to devalue.parse could represent an object with a __proto__ property and devalue.parse does not check that an index is numeric. This could result in assigning prototypes to objects and properties, leading to prototype pollution. This issue has been fixed in version 5.3.2","source":"cvelist"},{"lang":"en","text":"## 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Svelte devalue es una librería de utilidades. Antes de la versión 5.3.2, una cadena pasada a devalue.parse podía representar un objeto con una propiedad __proto__ y devalue.parse no verificaba si un índice era numérico. Esto podía provocar la asignación de prototipos a objetos y propiedades, lo que generaba contaminación de prototipos. Este problema se ha corregido en la versión 5.3.2.","source":"nvd"}],"published":"2025-08-26T22:33:14.000Z","modified":"2026-06-17T09:43:29.903Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":7.9,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":7.9,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"}],"cwes":["CWE-1321"],"affected":[{"ranges":[{"version":"< 5.3.2","status":"affected"}],"vendor":"sveltejs","product":"devalue","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"5.3.2"}],"ecosystem":"npm","package":"devalue","purl":"pkg:npm/devalue","source":"ghsa"}],"references":[{"url":"https://github.com/sveltejs/devalue/security/advisories/GHSA-vj54-72f3-p5jv","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/sveltejs/devalue/commit/0623a47c9555b639c03ff1baea82951b2d9d1132","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-57820","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/sveltejs/devalue","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-08-27T20:42:34.984Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-57820","url":"https://www.cve.org/CVERecord?id=CVE-2025-57820","licence":"CVE Terms of Use","modified":"2025-08-27T20:42:46.786Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vj54-72f3-p5jv","url":"https://github.com/advisories/GHSA-vj54-72f3-p5jv","licence":"CC-BY-4.0","modified":"2025-08-27T14:27:08.000Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-57820","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-57820","licence":"Public domain","modified":"2026-06-17T09:43:29.903Z"}],"updatedAt":"2026-11-25T22:59:03.724Z","epss":{"score":0.00421,"percentile":0.38403,"date":"2026-12-01T12:00:22.000Z"}}