Critical

Elysia vulnerable to prototype pollution with multiple standalone schema validation

  • Disclosed: 09.12.2025
  • Updated: 11.10.2026 10:22

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:

ts
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

ts
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
			})
	})

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package elysia >= 1.4.0, < 1.4.17 1.4.17

References

CVSS score -
CVSS vector
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
Weakness (CWE)
CWE-1321
Platform
npm
Package
elysia
Disclosed
09.12.2025
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-hxj9-33pp-j2cc - CC BY 4.0

Vulnerability history: elysia

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
5
First → latest
12.2025 09.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 1
  • High 3
  • Medium 1

Disclosures per year

  1. 2025: 2
  2. 2026: 3
  1. Medium · 6.5 CVE-2026-31865 < 1.4.27 1.4.27
  2. High · 7.5 CVE-2026-30837 < 1.4.26 1.4.26
  3. Elysia vulnerable to prototype pollution with multiple standalone schema validation this entry
    Critical CVE-2025-66456 >= 1.4.0, < 1.4.17 1.4.17

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.