{"id":"CVE-2025-66456","aliases":["GHSA-hxj9-33pp-j2cc"],"url":"https://o3.security/vulnerability/CVE-2025-66456","summary":"Elysia vulnerable to prototype pollution with multiple standalone schema validation","details":"Prototype pollution vulnerability in `mergeDeep` after merging results of two standard schema validations with the same key. Due to the ordering of merging, there must be an `any` type that is set as a `standalone` guard, to allow for the `__proto__` prop to be merged.\n\nWhen combined with GHSA-8vch-m3f4-q8jf this allows for a full RCE by an attacker.\n\n### Impact\nRoutes with more than 2 standalone schema validation, eg. zod\n\nExample vulnerable code:\n```typescript\nimport { Elysia } from \"elysia\"\nimport * as z from \"zod\"\n\nconst app = new Elysia()\n\t.guard({\n\t\tschema: \"standalone\",\n\t\tbody: z.object({\n\t\t\tdata: z.any()\n\t\t})\n\t})\n\t.post(\"/\", ({ body }) => ({ body, win: {}.foo }), {\n\t\tbody: z.object({\n\t\t\tdata: z.object({\n\t\t\t\tmessageId: z.string(\"pollute-me\"),\n\t\t\t})\n\t\t})\n\t})\n```\n\n### Patches\nPatched by 1.4.17 (https://github.com/elysiajs/elysia/pull/1564)\n\nReference commit:\n- https://github.com/elysiajs/elysia/pull/1564/commits/26935bf76ebc43b4a43d48b173fc853de43bb51e\n- https://github.com/elysiajs/elysia/pull/1564/commits/3af978663e437dccc6c1a2a3aff4b74e1574849e\n\n### Workarounds\nRemove `__proto__` key from body\n\nExample plugin for removing `__proto__` from body\n\n```typescript\nnew Elysia()\n\t.onTransform(({ body, headers }) => {\n\t\tif (headers['content-type'] === 'application/json')\n\t\t\treturn JSON.parse(JSON.stringify(body), (k, v) => {\n\t\t\t\tif (k === '__proto__') return\n\n\t\t\t\treturn v\n\t\t\t})\n\t})\n```","published":"2025-12-09T19:43:10.252Z","modified":"2026-10-28T02:30:58.374388490Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"elysia","fixedVersion":"1.4.17"}],"fix":{"url":"https://github.com/elysiajs/elysia/commit/26935bf76ebc43b4a43d48b173fc853de43bb51e","label":"elysiajs/elysia@26935bf"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/66xxx/CVE-2025-66456.json"},{"type":"ADVISORY","url":"https://github.com/elysiajs/elysia/security/advisories/GHSA-8vch-m3f4-q8jf"},{"type":"ADVISORY","url":"https://github.com/elysiajs/elysia/security/advisories/GHSA-hxj9-33pp-j2cc"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-66456"},{"type":"FIX","url":"https://github.com/elysiajs/elysia/commit/26935bf76ebc43b4a43d48b173fc853de43bb51e"},{"type":"FIX","url":"https://github.com/elysiajs/elysia/commit/3af978663e437dccc6c1a2a3aff4b74e1574849e"},{"type":"FIX","url":"https://github.com/elysiajs/elysia/pull/1564"},{"type":"PACKAGE","url":"https://github.com/elysiajs/elysia"},{"type":"WEB","url":"https://github.com/sportshead/elysia-poc"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T02:30:58.374388490Z"}}