CVE-2025-66456

CVE-2025-66456 is a critical-severity security vulnerability in elysia (npm), affecting versions >= 1.4.0, < 1.4.17. It is fixed in 1.4.17.

Summary

Elysia vulnerable to prototype pollution with multiple standalone schema validation

Full technical description

Prototype pollution vulnerability in mergeDeep after merging results of two standard schema validations with the same key. Due to the ordering of merging, there must be an any type that is set as a standalone guard, to allow for the __proto__ prop to be merged.

When combined with GHSA-8vch-m3f4-q8jf this allows for a full RCE by an attacker.

Workarounds

Remove __proto__ key from body

Example plugin for removing __proto__ from body

new Elysia()
	.onTransform(({ body, headers }) => {
		if (headers['content-type'] === 'application/json')
			return JSON.parse(JSON.stringify(body), (k, v) => {
				if (k === '__proto__') return

				return v
			})
	})

Impact

Routes with more than 2 standalone schema validation, eg. zod

Example vulnerable code:

import { Elysia } from "elysia"
import * as z from "zod"

const app = new Elysia()
	.guard({
		schema: "standalone",
		body: z.object({
			data: z.any()
		})
	})
	.post("/", ({ body }) => ({ body, win: {}.foo }), {
		body: z.object({
			data: z.object({
				messageId: z.string("pollute-me"),
			})
		})
	})

Affected versions

elysia (>= 1.4.0, < 1.4.17)

Security releases

elysia → 1.4.17 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Patched by 1.4.17 (https://github.com/elysiajs/elysia/pull/1564)

Reference commit:

Frequently Asked Questions

  1. What is CVE-2025-66456? CVE-2025-66456 is a critical-severity security vulnerability in elysia (npm), affecting versions >= 1.4.0, < 1.4.17. It is fixed in 1.4.17.
  2. Which versions of elysia are affected by CVE-2025-66456? elysia (npm) versions >= 1.4.0, < 1.4.17 is affected.
  3. Is there a fix for CVE-2025-66456? Yes. CVE-2025-66456 is fixed in 1.4.17. Upgrade to this version or later.
  4. Is CVE-2025-66456 exploitable, and should I be worried? Whether CVE-2025-66456 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether CVE-2025-66456 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix CVE-2025-66456? Upgrade elysia to 1.4.17 or later.

Other vulnerabilities in elysia

Stop the waste.
Protect your environment with Kodem.