CVE-2025-66457 Elysia affected by arbitrary code injection through cookie config

High 7.5 Published Updated

Attackers with write access to cookie config can inject arbitrary code into Elysia routes, leading to remote code execution.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-66457?

CVE-2025-66457 is a high-severity code injection vulnerability in elysiajs elysia, published on 9 Dec 2025. An attacker needs administrator access to exploit it, with no action from the victim.

Official 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.

Weakness: CWE-94

Which versions are affected by CVE-2025-66457?

2 open source packages ship an affected version, including elysia. It affects 1 product.

PackageAffectedFixed in
elysia npmAll versions1.4.18
elysia npmAll versions1.4.18

Products include Elysiajs Elysia.

How do I fix CVE-2025-66457?

Upgrade elysia to 1.4.18 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2025-66457 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-66457 exists.

Sources

Also known as GHSA-8vch-m3f4-q8jf.

Is CVE-2025-66457 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free