CVE-2025-66457: CWE-94: Improper Control of Generation of Code ('Code Injection') in elysiajs elysia
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.
AI Analysis
Technical Summary
CVE-2025-66457 is a vulnerability classified under CWE-94 (Improper Control of Generation of Code) affecting the Elysia Typescript framework, specifically versions 1.4.17 and earlier. Elysia is used for request validation, type inference, OpenAPI documentation, and client-server communication. The vulnerability occurs when dynamic cookies are enabled, and the cookie configuration is injected directly into the compiled route code without proper sanitization. This flaw allows an attacker with write access to the cookie configuration to inject arbitrary code, leading to potential arbitrary code execution within the application context. The exploitability is generally low because it requires write access to either the source code or the cookie configuration, which is typically controlled by the environment. However, when combined with another vulnerability (GHSA-hxj9-33pp-j2cc), it can form a complete remote code execution chain, significantly increasing the threat. The vulnerability does not require user interaction but does require privileges to modify configuration data, which limits exposure to insider threats or compromised deployment pipelines. The vulnerability has a CVSS v4.0 score of 7.5, indicating high severity, with network attack vector, low attack complexity, and privileges required. The vendor fixed the issue in version 1.4.18, and no known exploits are currently reported in the wild.
Potential Impact
For European organizations, the impact of CVE-2025-66457 can be significant if they use the Elysia framework in affected versions and rely on dynamic cookie configurations. Successful exploitation could lead to arbitrary code execution, compromising confidentiality, integrity, and availability of affected systems. This could result in unauthorized access to sensitive data, disruption of services, and potential lateral movement within networks. The requirement for write access to configuration reduces the likelihood of external attackers exploiting this vulnerability directly, but insider threats or compromised CI/CD pipelines could leverage it. Organizations in sectors with high reliance on web applications and APIs, such as finance, healthcare, and government, could face elevated risks. Additionally, the ability to chain this vulnerability with others to achieve full RCE increases the potential impact, making it critical to address promptly. Failure to patch could lead to compliance issues under GDPR and other European data protection regulations if data breaches occur.
Mitigation Recommendations
European organizations should immediately upgrade Elysia framework instances to version 1.4.18 or later to remediate this vulnerability. Additionally, they should enforce strict access controls and auditing on configuration management systems to prevent unauthorized modifications to cookie configurations. Implement environment hardening by isolating configuration provisioning processes and using immutable infrastructure principles where possible. Conduct thorough code reviews and automated scanning to detect unsafe code injection patterns. Employ runtime application self-protection (RASP) and web application firewalls (WAF) configured to detect anomalous behavior related to cookie handling. Regularly monitor logs for suspicious changes to configuration files or unexpected code execution patterns. Finally, integrate vulnerability management processes to track dependencies and ensure timely updates of third-party frameworks like Elysia.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Italy, Spain
CVE-2025-66457: CWE-94: Improper Control of Generation of Code ('Code Injection') in elysiajs elysia
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.
AI-Powered Analysis
Technical Analysis
CVE-2025-66457 is a vulnerability classified under CWE-94 (Improper Control of Generation of Code) affecting the Elysia Typescript framework, specifically versions 1.4.17 and earlier. Elysia is used for request validation, type inference, OpenAPI documentation, and client-server communication. The vulnerability occurs when dynamic cookies are enabled, and the cookie configuration is injected directly into the compiled route code without proper sanitization. This flaw allows an attacker with write access to the cookie configuration to inject arbitrary code, leading to potential arbitrary code execution within the application context. The exploitability is generally low because it requires write access to either the source code or the cookie configuration, which is typically controlled by the environment. However, when combined with another vulnerability (GHSA-hxj9-33pp-j2cc), it can form a complete remote code execution chain, significantly increasing the threat. The vulnerability does not require user interaction but does require privileges to modify configuration data, which limits exposure to insider threats or compromised deployment pipelines. The vulnerability has a CVSS v4.0 score of 7.5, indicating high severity, with network attack vector, low attack complexity, and privileges required. The vendor fixed the issue in version 1.4.18, and no known exploits are currently reported in the wild.
Potential Impact
For European organizations, the impact of CVE-2025-66457 can be significant if they use the Elysia framework in affected versions and rely on dynamic cookie configurations. Successful exploitation could lead to arbitrary code execution, compromising confidentiality, integrity, and availability of affected systems. This could result in unauthorized access to sensitive data, disruption of services, and potential lateral movement within networks. The requirement for write access to configuration reduces the likelihood of external attackers exploiting this vulnerability directly, but insider threats or compromised CI/CD pipelines could leverage it. Organizations in sectors with high reliance on web applications and APIs, such as finance, healthcare, and government, could face elevated risks. Additionally, the ability to chain this vulnerability with others to achieve full RCE increases the potential impact, making it critical to address promptly. Failure to patch could lead to compliance issues under GDPR and other European data protection regulations if data breaches occur.
Mitigation Recommendations
European organizations should immediately upgrade Elysia framework instances to version 1.4.18 or later to remediate this vulnerability. Additionally, they should enforce strict access controls and auditing on configuration management systems to prevent unauthorized modifications to cookie configurations. Implement environment hardening by isolating configuration provisioning processes and using immutable infrastructure principles where possible. Conduct thorough code reviews and automated scanning to detect unsafe code injection patterns. Employ runtime application self-protection (RASP) and web application firewalls (WAF) configured to detect anomalous behavior related to cookie handling. Regularly monitor logs for suspicious changes to configuration files or unexpected code execution patterns. Finally, integrate vulnerability management processes to track dependencies and ensure timely updates of third-party frameworks like Elysia.
Affected Countries
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2025-12-01T22:51:54.581Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 69388517f4a79be77cca2bcc
Added to database: 12/9/2025, 8:22:47 PM
Last enriched: 12/16/2025, 8:38:54 PM
Last updated: 2/7/2026, 4:33:03 AM
Views: 118
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.