CVE-2025-66456: Elysia Elysia Vulnerable To Prototype Pollution Vulnerability

CRITICAL
Advisory Identifier: GHSA-hxj9-33pp-j2cc
CWE-1321
Published
Advisory Summary

CVE-2025-66456 is a CRITICAL elysia vulnerable to prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Elysia libraries in the npm ecosystem. The issue involves elysia vulnerable to prototype pollution with multiple standalone schema validation. Remediation is available by upgrading affected packages to version 1.4.17.

CVE-2025-66456 at a Glance

CVE Identifier CVE-2025-66456
GHSA Identifier GHSA-hxj9-33pp-j2cc
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product Elysia
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-66456

To remediate this vulnerability, upgrade all affected Elysia dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

elysia fixed: 1.4.17
npm install elysia@1.4.17
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls elysia

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-66456, inspect your project dependencies using npm:

npm ls elysia

Analyze the terminal output to locate any version of Elysia in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.17), your application is affected.

Note: The npm ls elysia command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In Elysia, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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: ```typescript 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 ```typescript 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 }) }) ```

CVE-2025-66456 Affected Elysia Versions

1 component(s)
Fixed Versions:
1.4.17
Product / Package Ecosystem Affected Versions Fixed Version
elysia
npm
≥ 1.4.0
< 1.4.17
1.4.17

References

Frequently Asked Questions

What is CVE-2025-66456?
CVE-2025-66456 is a security vulnerability in Elysia involving Elysia vulnerable to prototype pollution with multiple standalone schema validation under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which Elysia versions are affected?
Affected versions include releases prior to 1.4.17 across affected packages: elysia.
What version fixes CVE-2025-66456?
Upgrading to 1.4.17 (or the latest patched release for your respective branch) resolves the vulnerability.
Is elysia affected?
Yes, elysia is affected in releases prior to 1.4.17. Upgrade your dependency to 1.4.17 or later.
What CWE is associated with CVE-2025-66456?
CVE-2025-66456 is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') (The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.).
How can I check npm dependencies for CVE-2025-66456?
Run the dependency tree command: 'npm ls elysia'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hxj9-33pp-j2cc",
  "modified" : "2025-12-09T21:37:06Z",
  "published" : "2025-12-09T17:11:53Z",
  "aliases" : [ "CVE-2025-66456" ],
  "summary" : "Elysia vulnerable to prototype pollution with multiple standalone schema validation",
  "details" : "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.\n\nWhen combined with GHSA-8vch-m3f4-q8jf this allows for a full RCE by an attacker.\n\n### Impact\nRoutes with more than 2 standalone schema validation, eg. zod\n\nExample vulnerable code:\n```typescript\nimport { Elysia } from \"elysia\"\nimport * as z from \"zod\"\n\nconst app = new Elysia()\n\t.guard({\n\t\tschema: \"standalone\",\n\t\tbody: z.object({\n\t\t\tdata: z.any()\n\t\t})\n\t})\n\t.post(\"/\", ({ body }) => ({ body, win: {}.foo }), {\n\t\tbody: z.object({\n\t\t\tdata: z.object({\n\t\t\t\tmessageId: z.string(\"pollute-me\"),\n\t\t\t})\n\t\t})\n\t})\n```\n\n### Patches\nPatched by 1.4.17 (https://github.com/elysiajs/elysia/pull/1564)\n\nReference commit:\n- https://github.com/elysiajs/elysia/pull/1564/commits/26935bf76ebc43b4a43d48b173fc853de43bb51e\n- https://github.com/elysiajs/elysia/pull/1564/commits/3af978663e437dccc6c1a2a3aff4b74e1574849e\n\n### Workarounds\nRemove `__proto__` key from body\n\nExample plugin for removing `__proto__` from body\n\n```typescript\nnew Elysia()\n\t.onTransform(({ body, headers }) => {\n\t\tif (headers['content-type'] === 'application/json')\n\t\t\treturn JSON.parse(JSON.stringify(body), (k, v) => {\n\t\t\t\tif (k === '__proto__') return\n\n\t\t\t\treturn v\n\t\t\t})\n\t})\n```",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "elysia"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.4.0"
      }, {
        "fixed" : "1.4.17"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/elysiajs/elysia/security/advisories/GHSA-8vch-m3f4-q8jf"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/elysiajs/elysia/security/advisories/GHSA-hxj9-33pp-j2cc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-66456"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/elysiajs/elysia/pull/1564"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/elysiajs/elysia/commit/26935bf76ebc43b4a43d48b173fc853de43bb51e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/elysiajs/elysia/commit/3af978663e437dccc6c1a2a3aff4b74e1574849e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/elysiajs/elysia"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sportshead/elysia-poc"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-09T17:11:53Z",
    "nvd_published_at" : "2025-12-09T20:15:54Z"
  }
}