{"id":"GHSA-hxj9-33pp-j2cc","revision":"36e99b81bfbd4dd8a584ed54d80abc64","records":[{"revision":"36e99b81bfbd4dd8a584ed54d80abc64","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-hxj9-33pp-j2cc","aliases":["CVE-2025-66456"],"title":"Elysia vulnerable to prototype pollution with multiple standalone schema validation","description":"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```","state":0,"publishedAt":"2025-12-09T17:11:53+00:00","modifiedAt":"2026-02-04T03:31:17.532002+00:00","affected":[{"ecosystem":"npm","name":"elysia","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"1.4.0"},{"kind":"fixed","version":"1.4.17"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"CRITICAL"}],"references":["https://github.com/elysiajs/elysia/security/advisories/GHSA-8vch-m3f4-q8jf","https://github.com/elysiajs/elysia/security/advisories/GHSA-hxj9-33pp-j2cc","https://nvd.nist.gov/vuln/detail/CVE-2025-66456","https://github.com/elysiajs/elysia/pull/1564","https://github.com/elysiajs/elysia/commit/26935bf76ebc43b4a43d48b173fc853de43bb51e","https://github.com/elysiajs/elysia/commit/3af978663e437dccc6c1a2a3aff4b74e1574849e","https://github.com/elysiajs/elysia","https://github.com/sportshead/elysia-poc"],"sourceUrl":"https://github.com/advisories/GHSA-hxj9-33pp-j2cc","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-hxj9-33pp-j2cc","identifiers":["GHSA-hxj9-33pp-j2cc","CVE-2025-66456"]},"retained":false,"historicalAffected":[]}],"coverage":[]}