Elysia
CVE-2025-66457
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessGain write access to cookie config (e.g. env var)
-
DeliveryInject crafted JS into cookie secret/field
-
ExploitConfig injected unsanitised into compiled route
-
ExecutionCode executes server-side on request
-
ImpactArbitrary code execution on host
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires ALL of: (1) AOT/ahead-of-time compilation enabled, which is the default; (2) a cookie schema defined on a route (i.e. 'dynamic cookies' enabled, e.g. via t.Cookie({...})); and (3) attacker-controllable cookie config - specifically the cookie secrets, domain, or related fields, such as when these are provisioned from environment variables the attacker can set. The primary limiting factor is that the attacker must have write access to the cookie config or source code; if they can write source code the flaw is moot, so realistic risk exists only where config is externally provisioned (env injection) and untrusted. Impact escalates to a full unauthenticated RCE chain only when combined with prototype-pollution GHSA-hxj9-33pp-j2cc. Affected: elysiajs/elysia versions 1.4.17 and below on Node.js/Bun. |
| Impact | This is a genuine but conditional RCE (CWE-94 code injection) whose real-world priority is LOW-to-MODERATE despite the 7.5 CVSS 4.0 score. The strongest signal against high priority is the privilege requirement: the vendor's own advisory and CVSS vector both indicate PR:H and attack requirements (AT:P) - exploitation needs write access to the cookie config, which the advisory concedes is 'generally low' availability because an attacker with write access to source code already has full control. EPSS is low at 0.81% (56th percentile), consistent with a config-dependent flaw that is not mass-scannable, so it is unlikely to be opportunistically exploited at scale. KEV status is NO - not listed by CISA, so there is no confirmed active exploitation. A public POC exists (sportshead/elysia-poc) and a test case in the patch demonstrates the injection, so proof of exploitability is confirmed, but POC availability is distinct from active exploitation and should not be conflated. The CVSS vector marks AV:N, yet the description and advisory make clear the true injection surface is the cookie config (e.g. provisioned via environment variables), i.e. local/config control rather than a remote network payload - verify deployment model, as AV:N overstates remote reachability for most configurations. Net: a real vulnerability worth patching, but not an emergency unless the cookie config is attacker-influenceable (e.g. env-injected) AND the prototype-pollution chain (GHSA-hxj9-33pp-j2cc) is also present to enable full unauthenticated RCE. |
| Exploit ScenarioDerived | In a deployment where Elysia's cookie config (e.g. the signing secret or domain) is populated from an environment variable the attacker can influence, and a cookie schema is defined on a route with AOT compilation enabled (default), the attacker sets the config value to a crafted string like |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 14, 2026
Code injection in the Elysia TypeScript framework (versions 1.4.17 and below) lets an attacker who can control the cookie configuration - such as cookie secrets or domain provisioned via environment variables - inject and execute arbitrary JavaScript when a route is compiled with dynamic cookies enabled (i.e. a cookie schema is present and the default AOT compilation is active). Exploitation is conditional and privilege-gated: the attacker must already possess write access to the app source code (in which case the flaw is largely moot) or, more realistically, to externally provisioned cookie config such as environment variables; the vendor notes that chaining this with prototype-pollution issue GHSA-hxj9-33pp-j2cc escalates it to a full RCE chain. Publicly available exploit code exists (including a dedicated PoC repository), but EPSS is low at 0.81% (56th percentile) and there is no CISA KEV confirmation of active exploitation; the vendor-released fix is version 1.4.18.
RemediationAI
Vendor-released patch: upgrade Elysia to version 1.4.18 or later, which contains the overrideUnsafeQuote escaping and the mergeDeep prototype-key hardening delivered in PR #1564 (commits 26935bf76ebc43b4a43d48b173fc853de43bb51e and 3af978663e437dccc6c1a2a3aff4b74e1574849e); see advisories GHSA-8vch-m3f4-q8jf and GHSA-hxj9-33pp-j2cc and the PoC at github.com/sportshead/elysia-poc. If immediate upgrade is not possible, apply the vendor's documented workaround of sanitizing cookie-related environment input by escaping backticks and ${ sequences before it reaches the cookie config (e.g. a helper that replaces with \ and ${ with $\{), accepting that this is a manual control that must be applied everywhere config is sourced. Because the root prerequisite is attacker-controllable cookie configuration, the strongest compensating control is to treat all cookie secrets, sign keys, and domain values as trusted-only: restrict who can set these environment variables, do not derive them from untrusted or user-influenced input, and audit config-provisioning paths; the trade-off is operational rigidity where config is dynamic per environment. Organizations concerned about the chained RCE should also ensure their dependency tree is free of the prototype-pollution issue referenced by GHSA-hxj9-33pp-j2cc, since only the combination escalates this code-injection flaw into a full remote exploitation chain.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Elysia uses ahead-of-time (AOT) route compilation, in which a route's handler and its associated cookie metadata are assembled into generated JavaScript source and then evaluated. When dynamic cookies are enabled - that is, a cookie schema such as t.Cookie({ foo: t.Any() }) is attached to a route - the framework interpolates cookie configuration values (secrets, sign keys, domain, etc.) directly into template strings in the compiled output using single quotes and unescaped backtick/${ sequences. If those values are attacker-influenced (for example, set through environment variables), the injected text breaks out of the string literal and is executed as code at compile time. This is a classic CWE-94 improper control of code generation / code injection flaw: untrusted input is treated as code rather than data. The affected package is identified by CPE cpe:2.3:a:elysiajs:elysia:*:*:*:*:*:node.js:*:*, and the fix (PR #1564, commits 26935bf76ebc43b4a43d48b173fc853de43bb51e and 3af978663e437dccc6c1a2a3aff4b74e1574849e) introduces an overrideUnsafeQuote helper that escapes backticks and ${ sequences and also hardens mergeDeep in src/utils.ts by skipping the __proto__, constructor, and prototype keys to block the associated prototype-pollution vector.
Know when Elysia gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Exploitation requires write access to the cookie config (env/config-provisioned), so AV:L and PR:H; successful injection yields arbitrary server-side code execution, giving C/I/A High.
Primary rating from Vendor (github).
CVSS VectorVendor: github
DescriptionCVE.org
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.
Executive ViewAI
Elysia, a TypeScript server framework used in our application stack, contains a code injection flaw in versions 1.4.17 and below that can let an attacker execute arbitrary JavaScript when a route is compiled with dynamic cookies enabled. The practical risk is concentrated in services where cookie secrets, domains, or other configuration are provisioned through environment variables or CI/CD pipelines that attackers could reach, and the vendor notes the flaw chains with prototype-pollution issue GHSA-hxj9-33pp-j2cc to reach full remote code execution. Publicly available exploit code exists, but there is no CISA KEV confirmation of active exploitation and EPSS is low at 0.81%, so this is a patchable exposure that should be closed through standard dependency management rather than an emergency response.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Affected Products (CPE)CVE.org
Prototype pollution in the Elysia TypeScript framework (npm/elysia, versions 1.4.0 through 1.4.16) allows an unauthentic
OpenAPI documentation and client-server communication. versions up to 1.4.26 is affected by inefficient regular expressi
NVD
CVE.org
EPSS
GitHub
Exploit-DB