Arbitrary Code Injection Affecting elysia package, versions <1.4.17


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.07% (21st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Arbitrary Code Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-ELYSIA-14287466
  • published10 Dec 2025
  • disclosed9 Dec 2025
  • creditsportshead

Introduced: 9 Dec 2025

NewCVE-2025-66457  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

Upgrade elysia to version 1.4.17 or higher.

Overview

elysia is an Ergonomic Framework for Human

Affected versions of this package are vulnerable to Arbitrary Code Injection via the cookie config. An attacker can execute arbitrary code by injecting malicious input into the configuration when dynamic cookies are enabled and the cookie schema is provisioned by the environment.

Note: This is only exploitable if an attacker has write access to the cookie configuration.

Workaround

This vulnerability can be mitigated by sanitizing cookie-related input from the environment before it is used.

PoC

new Elysia({
    cookie: {
        secrets: `' + console.log('pwned from secrets') + '`
    },
})
    .get("/", () => "hello world", {
        cookie: t.Cookie({
            foo: t.Any(),
        }),
    })

CVSS Base Scores

version 4.0
version 3.1