{"id":"CVE-2025-66457","aliases":["EUVD-2025-202179","GHSA-8vch-m3f4-q8jf"],"status":"published","title":"Elysia affected by arbitrary code injection through cookie config","description":"Elysia is a Typescript framework for request validation, type inference, OpenAPI documentation and client-server communication. Versions 1.4.17 and below are subject to arbitrary code execution from cookie config. When dynamic cookies are enabled (e.g. there  an existing cookie schema), the cookie config is injected into the compiled route without first being sanitised. Availability of this exploit is generally low, but when combined with GHSA-hxj9-33pp-j2cc, it allows for a full RCE chain. An attack requires write access to either the Elysia app's source code (in which case the vulnerability is meaningless) or write access to the cookie config (perhaps where it is assumed to be provisioned by the environment). This issue is fixed in version 1.4.18.","severity":{"version":"4.0","score":7.5,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.00865,"percentile":0.59064,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-94"],"published":"2025-12-09T17:12:05Z","modified":"2026-11-11T10:30:52Z","fixes":[{"ecosystem":"npm","package":"elysia","fixed_in":["1.4.18"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"elysia","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.4.18"}]}]},{"source":"osv","ecosystem":"npm","package":"elysia","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.4.18"}]}]}],"products":[{"vendor":"elysiajs","product":"elysia"}],"references":[{"url":"https://github.com/elysiajs/elysia/security/advisories/GHSA-8vch-m3f4-q8jf","tags":["x_refsource_CONFIRM","Exploit","Patch","Vendor Advisory","advisory","web"]},{"url":"https://github.com/elysiajs/elysia/security/advisories/GHSA-hxj9-33pp-j2cc","tags":["x_refsource_MISC","Not Applicable","advisory","web"]},{"url":"https://github.com/elysiajs/elysia/pull/1564","tags":["x_refsource_MISC","Issue Tracking","Patch","fix","web"]},{"url":"https://github.com/elysiajs/elysia/commit/26935bf76ebc43b4a43d48b173fc853de43bb51e","tags":["x_refsource_MISC","Patch","fix","web"]},{"url":"https://github.com/elysiajs/elysia/commit/3af978663e437dccc6c1a2a3aff4b74e1574849e","tags":["x_refsource_MISC","Patch","fix","web"]},{"url":"https://github.com/sportshead/elysia-poc","tags":["exploit","Exploit","Third Party Advisory","evidence","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-66457","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-8vch-m3f4-q8jf"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/66xxx/CVE-2025-66457.json","tags":["advisory"]},{"url":"https://github.com/elysiajs/elysia","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2025-66457","title":"Elysia affected by arbitrary code injection through cookie config","description":"Elysia is a Typescript framework for request validation, type inference, OpenAPI documentation and client-server communication. Versions 1.4.17 and below are subject to arbitrary code execution from cookie config. When dynamic cookies are enabled (e.g. there  an existing cookie schema), the cookie config is injected into the compiled route without first being sanitised. Availability of this exploit is generally low, but when combined with GHSA-hxj9-33pp-j2cc, it allows for a full RCE chain. An attack requires write access to either the Elysia app's source code (in which case the vulnerability is meaningless) or write access to the cookie config (perhaps where it is assumed to be provisioned by the environment). This issue is fixed in version 1.4.18.","status":"published","published":"2025-12-09T20:03:45.918Z","modified":"2025-12-12T19:39:02.677Z","cvss":[{"version":"4.0","score":7.5,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"high","assessor":"cna"}],"cwes":["CWE-94"],"updated_at":"2026-11-02T14:32:53.475217Z"}],"euvd":[{"id":"EUVD-2025-202179","description":"Elysia is a Typescript framework for request validation, type inference, OpenAPI documentation and client-server communication. Versions 1.4.17 and below are subject to arbitrary code execution from cookie config. When dynamic cookies are enabled (e.g. there  an existing cookie schema), the cookie config is injected into the compiled route without first being sanitised. Availability of this exploit is generally low, but when combined with GHSA-hxj9-33pp-j2cc, it allows for a full RCE chain. An attack requires write access to either the Elysia app's source code (in which case the vulnerability is meaningless) or write access to the cookie config (perhaps where it is assumed to be provisioned by the environment). This issue is fixed in version 1.4.18.","status":"published","published":"2025-12-09T20:03:45Z","modified":"2025-12-12T19:39:02Z","cvss":[{"version":"4.0","score":7.5,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"high"}],"updated_at":"2026-11-02T19:49:05.821921Z"}],"ghsa":[{"id":"GHSA-8vch-m3f4-q8jf","title":"Elysia affected by arbitrary code injection through cookie config","description":"Arbitrary code execution from cookie config. If dynamic cookies are enabled (ie there exists a schema for cookies), the cookie config is injected into the compiled route without first being sanitised.\n\nAvailability of this exploit is generally low, as it requires write access to either the Elysia app's source code (in which case the vulnerability is meaningless) or write access to the cookie config (perhaps where it is assumed to be provisioned by the environment). \n\nHowever when combined with GHSA-hxj9-33pp-j2cc, this vulnerability allows for a full RCE chain.\n\n### Impact\n- aot enabled (default)\n- cookie schema passed to route\n- Cookie config controllable eg. via env\n\nExample of vulnerable code\n```js\nnew Elysia({\n\tcookie: {\n\t\tsecrets: `' + console.log('pwned from secrets') + '`\n\t},\n})\n\t.get(\"/\", () =\u003e \"hello world\", {\n\t\tcookie: t.Cookie({\n\t\t\tfoo: t.Any(),\n\t\t}),\n\t})\n```\n\nPOC: https://github.com/sportshead/elysia-poc\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\nSanitize cookie-related env input\n\n```typescript\nconst overrideUnsafeQuote = (value: string) =\u003e\n\t// '`' + value + '`'\n\t'`' + value.replace(/'/g, '\\\\`').replace(/\\${/g, '$\\\\{') + '`'\n```","status":"published","published":"2025-12-09T17:12:05Z","modified":"2025-12-09T21:37:20Z","cvss":[{"version":"4.0","score":7.5,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"high"}],"cwes":["CWE-94"],"updated_at":"2026-11-02T14:39:12.222121Z"}],"nvd":[{"id":"CVE-2025-66457","description":"Elysia is a Typescript framework for request validation, type inference, OpenAPI documentation and client-server communication. Versions 1.4.17 and below are subject to arbitrary code execution from cookie config. When dynamic cookies are enabled (e.g. there  an existing cookie schema), the cookie config is injected into the compiled route without first being sanitised. Availability of this exploit is generally low, but when combined with GHSA-hxj9-33pp-j2cc, it allows for a full RCE chain. An attack requires write access to either the Elysia app's source code (in which case the vulnerability is meaningless) or write access to the cookie config (perhaps where it is assumed to be provisioned by the environment). This issue is fixed in version 1.4.18.","status":"published","published":"2025-12-09T20:15:54.913Z","modified":"2026-10-14T21:10:00.183Z","cvss":[{"version":"4.0","score":7.5,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"high","assessor":"secondary"},{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"primary"}],"cwes":["CWE-94"],"updated_at":"2026-11-02T14:11:49.468427Z"}],"osv":[{"id":"CVE-2025-66457","title":"Elysia affected by arbitrary code injection through cookie config","description":"Elysia is a Typescript framework for request validation, type inference, OpenAPI documentation and client-server communication. Versions 1.4.17 and below are subject to arbitrary code execution from cookie config. When dynamic cookies are enabled (e.g. there  an existing cookie schema), the cookie config is injected into the compiled route without first being sanitised. Availability of this exploit is generally low, but when combined with GHSA-hxj9-33pp-j2cc, it allows for a full RCE chain. An attack requires write access to either the Elysia app's source code (in which case the vulnerability is meaningless) or write access to the cookie config (perhaps where it is assumed to be provisioned by the environment). This issue is fixed in version 1.4.18.","status":"published","published":"2025-12-09T20:03:45.918Z","modified":"2026-11-11T10:30:52.943315365Z","cvss":[{"version":"4.0","score":7.5,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"high"}],"cwes":["CWE-94"],"updated_at":"2026-11-11T11:06:36.179338Z"},{"id":"GHSA-8vch-m3f4-q8jf","title":"Elysia affected by arbitrary code injection through cookie config","description":"Arbitrary code execution from cookie config. If dynamic cookies are enabled (ie there exists a schema for cookies), the cookie config is injected into the compiled route without first being sanitised.\n\nAvailability of this exploit is generally low, as it requires write access to either the Elysia app's source code (in which case the vulnerability is meaningless) or write access to the cookie config (perhaps where it is assumed to be provisioned by the environment). \n\nHowever when combined with GHSA-hxj9-33pp-j2cc, this vulnerability allows for a full RCE chain.\n\n### Impact\n- aot enabled (default)\n- cookie schema passed to route\n- Cookie config controllable eg. via env\n\nExample of vulnerable code\n```js\nnew Elysia({\n\tcookie: {\n\t\tsecrets: `' + console.log('pwned from secrets') + '`\n\t},\n})\n\t.get(\"/\", () =\u003e \"hello world\", {\n\t\tcookie: t.Cookie({\n\t\t\tfoo: t.Any(),\n\t\t}),\n\t})\n```\n\nPOC: https://github.com/sportshead/elysia-poc\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\nSanitize cookie-related env input\n\n```typescript\nconst overrideUnsafeQuote = (value: string) =\u003e\n\t// '`' + value + '`'\n\t'`' + value.replace(/'/g, '\\\\`').replace(/\\${/g, '$\\\\{') + '`'\n```","status":"published","published":"2025-12-09T17:12:05Z","modified":"2026-02-04T03:09:32.99299Z","cvss":[{"version":"4.0","score":7.5,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","level":"high"}],"cwes":["CWE-94"],"updated_at":"2026-11-02T15:46:42.78452Z"}]}}
