CVE-2025-66456
JSON

9.1critical

Elysia vulnerable to prototype pollution with multiple standalone schema validation

Severity
9.1critical CVSS:4.0 by GitHub_M
Exploit likelihood
0.60% (higher than 49% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-hxj9-33pp-j2cc

Description

Elysia is a Typescript framework for request validation, type inference, OpenAPI documentation and client-server communication. Versions 1.4.0 through 1.4.16 contain a 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. This issue is fixed in version 1.4.17. To workaround, remove the `__proto__ key` from body.

Affected

Product or packageVersionsReported by
elysiajs elysia>= 1.4.0, < 1.4.17, from 1.4.0 before 1.4.17CVE List, NVD
elysia (npm)from 1.4.0 before 1.4.17GitHub Advisory Database

All scores

GitHub_M9.1critical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
GitHubcritical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-1321

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.

What each source says

CVE List

Elysia is a Typescript framework for request validation, type inference, OpenAPI documentation and client-server communication. Versions 1.4.0 through 1.4.16 contain a 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. This issue is fixed in version 1.4.17. To workaround, remove the `__proto__ key` from body.

GitHub Advisory Database

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.

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"),
			})
		})
	})
Patches

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

Reference commit:

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
			})
	})
NVD (es)

Elysia es un framework de Typescript para validación de solicitudes, inferencia de tipos, documentación OpenAPI y comunicación cliente?servidor. Las versiones 1.4.0 hasta 1.4.16 contienen una vulnerabilidad de contaminación de prototipos en 'mergeDeep' después de combinar los resultados de dos validaciones de esquema estándar con la misma clave. Debido al orden de combinación, debe existir un any type que se establece como un guardia independiente, para permitir que la '__proto__ prop' sea fusionada. Cuando se combina con GHSA?8vch?m3f4?q8jf, esto permite una ejecución remota de código (RCE) completa por un atacante. Este problema está corregido en la versión 1.4.17. Como solución alternativa, elimine la clave '__proto__' del cuerpo.

References

Related

Sources

SourceRecordLicence
CVE ListCVE-2025-66456 changed 2025-12-09CVE Terms of Use
GitHub Advisory DatabaseGHSA-hxj9-33pp-j2cc changed 2026-02-04CC-BY-4.0
NVDCVE-2025-66456 changed 2026-10-14Public domain