CVE-2025-66456

9.8 CRITICAL

📋 TL;DR

This CVE describes a prototype pollution vulnerability in the Elysia TypeScript framework that, when combined with a separate advisory (GHSA-8vch-m3f4-q8jf), allows remote code execution (RCE). Attackers can exploit this by sending specially crafted requests containing '__proto__' keys to merge validation results, potentially taking full control of affected servers. All users running Elysia versions 1.4.0 through 1.4.16 are affected.

💻 Affected Systems

Products:
  • Elysia TypeScript Framework
Versions: 1.4.0 through 1.4.16
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Requires specific conditions: merging results of two standard schema validations with the same key and an 'any' type set as standalone guard.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full remote code execution leading to complete system compromise, data theft, and lateral movement within the network.

🟠

Likely Case

Server compromise allowing attackers to execute arbitrary code, steal sensitive data, and deploy malware or ransomware.

🟢

If Mitigated

Limited impact with proper input validation and security controls, potentially causing denial of service or limited data exposure.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires combining with GHSA-8vch-m3f4-q8jf for full RCE. The vulnerability itself is prototype pollution that enables further exploitation.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.4.17

Vendor Advisory: https://github.com/elysiajs/elysia/security/advisories/GHSA-hxj9-33pp-j2cc

Restart Required: Yes

Instructions:

1. Update Elysia to version 1.4.17 or later using npm: 'npm update elysia' or 'npm install elysia@latest'. 2. Restart your application server. 3. Verify the update by checking package.json or running 'npm list elysia'.

🔧 Temporary Workarounds

Remove __proto__ key from request body

all

Filter out '__proto__' keys from incoming request bodies before processing by Elysia validation.

// Middleware to strip __proto__ keys
app.use((ctx, next) => {
  if (ctx.body && typeof ctx.body === 'object') {
    delete ctx.body.__proto__;
  }
  return next();
});

🧯 If You Can't Patch

  • Implement strict input validation middleware to reject requests containing '__proto__' keys.
  • Deploy network-level protections such as WAF rules to block requests with '__proto__' in payloads.

🔍 How to Verify

Check if Vulnerable:

Check package.json or run 'npm list elysia' to see if version is between 1.4.0 and 1.4.16 inclusive.

Check Version:

npm list elysia | grep elysia

Verify Fix Applied:

Confirm Elysia version is 1.4.17 or higher using 'npm list elysia' and test that requests with '__proto__' keys are properly rejected.

📡 Detection & Monitoring

Log Indicators:

  • Unusual request patterns with '__proto__' in payloads
  • Unexpected process spawns or file system modifications

Network Indicators:

  • HTTP requests containing '__proto__' keys in JSON/body payloads
  • Unusual outbound connections from application servers

SIEM Query:

source="application_logs" AND ("__proto__" OR "prototype pollution")

🔗 References

📤 Share & Export