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 package | Versions | Reported by |
|---|---|---|
| elysiajs elysia | >= 1.4.0, < 1.4.17, from 1.4.0 before 1.4.17 | CVE List, NVD |
| elysia (npm) | from 1.4.0 before 1.4.17 | GitHub Advisory Database |
All scores
| GitHub_M | 9.1critical CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N |
| GitHub | critical CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Classification
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:
- https://github.com/elysiajs/elysia/pull/1564/commits/26935bf76ebc43b4a43d48b173fc853de43bb51e
- https://github.com/elysiajs/elysia/pull/1564/commits/3af978663e437dccc6c1a2a3aff4b74e1574849e
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
| https://github.com/elysiajs/elysia/security/advisories/GHSA-hxj9-33pp-j2cc | exploit, patch, vendor-advisory, web | |
| https://github.com/elysiajs/elysia/security/advisories/GHSA-8vch-m3f4-q8jf | exploit, not-applicable, web | |
| https://github.com/elysiajs/elysia/pull/1564 | issue-tracking, patch, web | |
| https://github.com/elysiajs/elysia/commit/26935bf76ebc43b4a43d48b173fc853de43bb51e | patch, web | |
| https://github.com/elysiajs/elysia/commit/3af978663e437dccc6c1a2a3aff4b74e1574849e | patch, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2025-66456 | advisory | |
| https://github.com/elysiajs/elysia | package | |
| https://github.com/sportshead/elysia-poc | web | |
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-66456 changed 2025-12-09 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-hxj9-33pp-j2cc changed 2026-02-04 | CC-BY-4.0 |
| NVD | CVE-2025-66456 changed 2026-10-14 | Public domain |