CVE-2025-66457
published 2025-12-09CVE-2025-66457: Elysia is a Typescript framework for request validation, type inference, OpenAPI documentation and client-server communication. Versions 1.4.17 and below are…
PriorityP261high8.8CVSS 3.1
AVNACLPRLUINSUCHIHAH
EPSS
0.68%
47.7th percentile
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.
Affected
2 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| elysiajs | elysia | < 1.4.18 | 1.4.18 |
| elysiajs | elysia | >= 0 < 1.4.18 | 1.4.18 |
CVSS provenance
nvdv3.18.8HIGHCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
nvdv4.07.5HIGHCVSS: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
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
GHSA
Elysia affected by arbitrary code injection through cookie config
ghsa·2025-12-09
CVE-2025-66457 [HIGH] CWE-94 Elysia affected by arbitrary code injection through cookie config
Elysia affected by arbitrary code injection through cookie config
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.
Availability 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).
However when combined with GHSA-hxj9-33pp-j2cc, this vulnerability allows for a full RCE chain.
### Impact
- aot enabled (default)
- cookie schema passed to route
- Cookie config controllable eg. via env
Example of vulnerable code
```js
new Elysia({
cookie: {
OSV
Elysia affected by arbitrary code injection through cookie config
osv·2025-12-09
CVE-2025-66457 [HIGH] Elysia affected by arbitrary code injection through cookie config
Elysia affected by arbitrary code injection through cookie config
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.
Availability 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).
However when combined with GHSA-hxj9-33pp-j2cc, this vulnerability allows for a full RCE chain.
### Impact
- aot enabled (default)
- cookie schema passed to route
- Cookie config controllable eg. via env
Example of vulnerable code
```js
new Elysia({
cookie: {
No detection rules found.
No public exploits indexed.
https://github.com/elysiajs/elysia/commit/26935bf76ebc43b4a43d48b173fc853de43bb51ehttps://github.com/elysiajs/elysia/commit/3af978663e437dccc6c1a2a3aff4b74e1574849ehttps://github.com/elysiajs/elysia/pull/1564https://github.com/elysiajs/elysia/security/advisories/GHSA-8vch-m3f4-q8jfhttps://github.com/elysiajs/elysia/security/advisories/GHSA-hxj9-33pp-j2cchttps://github.com/sportshead/elysia-poc
2025-12-09
Published