CVE-2025-66456
JavaScript vulnerability analysis and mitigation

Overview

CVE-2025-66456 is a prototype pollution vulnerability in the Elysia TypeScript web framework (npm package elysia) affecting versions 1.4.0 through 1.4.16. The flaw exists in the mergeDeep function, which fails to sanitize the __proto__ key when merging results of two standalone schema validations with the same key. When combined with a related advisory (GHSA-8vch-m3f4-q8jf / CVE-2025-66457), it enables a full Remote Code Execution (RCE) chain. It was disclosed on December 9, 2025, and carries a CVSS v3.1 base score of 9.8 (Critical) and a CVSS v4.0 score of 9.1 (Critical) (GitHub Advisory, Feedly).

Technical details

The root cause is classified as CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes). In Elysia's mergeDeep utility (src/utils.ts), when two standalone schema validations share the same key and one uses an any type as a guard, the merge ordering allows the __proto__ property from attacker-controlled request body input to be merged into the object prototype. The fix in version 1.4.17 explicitly skips __proto__, constructor, and prototype keys during deep merging. The companion vulnerability GHSA-8vch-m3f4-q8jf (CVE-2025-66457) involves unsanitized cookie config values being injected into compiled route code, and when chained with CVE-2025-66456, allows an attacker to escalate prototype pollution into arbitrary code execution. A public proof-of-concept exists at https://github.com/sportshead/elysia-poc (GitHub Advisory, Patch Commit).

Impact

Successful exploitation of CVE-2025-66456 alone results in high confidentiality and integrity impact by allowing an attacker to manipulate JavaScript object prototypes, potentially altering application behavior, bypassing access controls, or corrupting data. When chained with GHSA-8vch-m3f4-q8jf, the combined attack enables full Remote Code Execution (RCE) on the server hosting the Elysia application, giving an unauthenticated remote attacker complete control over the affected system, including the ability to exfiltrate sensitive data, establish persistence, or pivot to other internal systems (GitHub Advisory, Feedly).

Exploitability

A public proof-of-concept (PoC) repository (https://github.com/sportshead/elysia-poc) is referenced in the official security advisory, demonstrating the RCE chain. However, as of the advisory date, there is no confirmed evidence of active in-the-wild exploitation. The EPSS score is approximately 0.049% (0.000490), indicating a currently low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires the target application to have routes with more than two standalone schema validations and an any type guard, which limits the attack surface somewhat (GitHub Advisory, Feedly).

Exploitation steps

  1. Reconnaissance: Identify applications using Elysia npm package versions 1.4.0–1.4.16 with routes that define more than two standalone schema validations (e.g., using z.object() with Zod) and at least one z.any() type as a standalone guard.
  2. Craft malicious payload: Construct a JSON request body containing a __proto__ key with attacker-controlled properties, e.g.:
{
  "data": {
    "messageId": "pollute-me",
    "__proto__": {
      "foo": "bar"
    }
  }
}
  1. Send the request: Submit an HTTP POST request with Content-Type: application/json to the vulnerable route endpoint, triggering the mergeDeep function to merge the __proto__ key into the object prototype.
  2. Achieve prototype pollution: The __proto__ property is merged into Object.prototype, affecting all objects in the Node.js/Bun process and potentially altering application logic or security checks.
  3. Chain with GHSA-8vch-m3f4-q8jf for RCE: If the application also has a controllable cookie config (e.g., via environment variables), leverage the polluted prototype to inject malicious values into the cookie config, which is then compiled unsanitized into route code, achieving arbitrary code execution on the server (GitHub Advisory, PoC Commit).

Indicators of compromise

  • Network: Unexpected HTTP POST requests to application endpoints with JSON bodies containing __proto__, constructor, or prototype keys; unusual outbound connections from the application server process.
  • Logs: Application logs showing JSON parse errors or unexpected property merges; access logs with POST requests containing encoded __proto__ payloads in the body.
  • File System: Unexpected new files, scripts, or cron jobs created by the application's runtime process (Node.js/Bun); web shells or reverse shell scripts in the application directory.
  • Process: Unusual child processes spawned by the Bun or Node.js runtime (e.g., sh, bash, curl, wget); unexpected network listeners opened by the application process.
  • Application Behavior: Unexpected changes in object property behavior across the application (e.g., {}.foo returning an attacker-controlled value); application errors related to prototype chain corruption (GitHub Advisory).

Mitigation and workarounds

Upgrade Elysia to version 1.4.17 or later, which patches the mergeDeep function to explicitly skip __proto__, constructor, and prototype keys. For the companion RCE vulnerability (GHSA-8vch-m3f4-q8jf), upgrade to 1.4.18. As an immediate workaround if upgrading is not possible, add an onTransform hook to strip __proto__ from incoming JSON bodies:

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

Additionally, sanitize any cookie-related environment input using the overrideUnsafeQuote helper pattern introduced in the patch (GitHub Advisory, Patch PR).

Community reactions

The vulnerability was discovered and reported by security researcher sportshead, who also published a proof-of-concept repository. The Elysia maintainer (SaltyAom) responded promptly, releasing the patch on December 2, 2025 (merged PR #1564) and publishing the security advisory on December 9, 2025. The CVE appeared in Reddit's CVEWatch community as a top trending CVE for both December 10 and 11, 2025, and was noted by Checkmarx Zero on Bluesky, indicating moderate community attention. Red Hat also tracked the vulnerability in their security advisory database (GitHub Advisory, Red Hat).

Additional resources

  • GitHub Advisory — Primary security advisory for CVE-2025-66456
  • Related Advisory — Companion RCE advisory (GHSA-8vch-m3f4-q8jf / CVE-2025-66457)
  • Patch PR — Pull request #1564 implementing the 1.4.17 security fix
  • Fix Commit — Primary patch commit addressing prototype pollution and RCE
  • PoC Repository — Public proof-of-concept demonstrating the exploit chain
  • Red Hat Advisory — Red Hat CVE tracking page

SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-59160HIGH8.8
  • JavaScript logoJavaScript
  • @yeger/turbo-graph
NoYesSep 09, 2026
CVE-2026-59179HIGH8.3
  • JavaScript logoJavaScript
  • @openhop/server
NoYesSep 09, 2026
GHSA-x7m8-jrm8-hpvxHIGH8.1
  • JavaScript logoJavaScript
  • @eigenpal/docx-editor-core
NoYesSep 10, 2026
CVE-2026-59176HIGH7.8
  • JavaScript logoJavaScript
  • functype-mcp-server
NoYesSep 09, 2026
CVE-2026-59158HIGH7.5
  • JavaScript logoJavaScript
  • nuxt-ollama
NoYesSep 09, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management