Skip to main content

Elysia CVE-2025-66456

CRITICAL
Improperly Controlled Modification of Object Prototype Attributes (Prototype Pollution) (CWE-1321)
2025-12-09 security-advisories@github.com
9.1
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Send request with __proto__ in JSON body
  2. Delivery
    Reach route guarded by standalone any schema
  3. Exploit
    Merge pollutes Object.prototype via mergeDeep
  4. Execution
    Chain with unsanitized cookie-config injection
  5. Impact
    Execute arbitrary code on server

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V3 - Web Frontend Security Prototype pollution prevention
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires an Elysia application (v1.4.0-1.4.16) that defines a standalone guard (schema: 'standalone') whose body schema includes an any-typed field, so that during mergeDeep of two standard-schema validation results with the same key the merge ordering permits a __proto__ property to be merged into the prototype. For the full RCE chain, the app must additionally meet the GHSA-8vch-m3f4-q8jf conditions: AOT compilation enabled (the default), a cookie schema attached to a route, and an attacker-influenceable cookie config (e.g., cookie secrets provisioned via environment). Limiting factors: the standalone-guard-plus-any-type pattern is a non-default, application-specific configuration, and standalone prototype pollution only escalates to code execution when the cookie-config injection prerequisites are also present; without them impact is confined to prototype pollution.

Impact

The CVSS 4.0 base score of 9.1 (Critical) reflects a network-reachable, unauthenticated flaw (AV:N/PR:N/UI:N) with high confidentiality and integrity impact, but the AT:P metric correctly signals that exploitation is NOT unconditional - a specific attack requirement must be met. That requirement is confirmed by both the description and the commit diff: the Elysia app must use a standalone guard whose body schema contains an any type, so that merge ordering in mergeDeep lets a __proto__ property survive. On its own this is a CWE-1321 prototype pollution issue; it only becomes full RCE when chained with GHSA-8vch-m3f4-q8jf (unsanitized cookie-config injection). The real-world signals temper the headline severity: EPSS is only 0.56% (45th percentile) and there is no CISA KEV listing, so there is no evidence of active widespread exploitation despite publicly available exploit code. The vendor's own advisory explicitly states exploit availability is 'generally low' because the RCE half of the chain requires write access to the cookie config. Net assessment: a genuinely serious flaw in affected deployments that use the specific standalone-guard-with-any pattern, but the non-default configuration prerequisite and low EPSS make it a lower practical priority than the Critical score alone implies - prioritize patching for apps matching the vulnerable pattern rather than treating it as mass-exploitable.

Exploit ScenarioDerived

An attacker sends a crafted HTTP request whose JSON body includes a __proto__ property to an Elysia endpoint whose route is protected by a standalone guard containing an any-typed body schema. During mergeDeep of the two standard-schema validation results, the __proto__ key is merged into Object.prototype; when combined with the cookie-config injection flaw (GHSA-8vch-m3f4-q8jf, which has a public POC at github.com/sportshead/elysia-poc), this yields arbitrary code execution on the server. Publicly available exploit code exists for this chain, though the required non-default configuration limits its reach.

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
Patch available 0.6% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 14, 2026

Prototype pollution in the Elysia TypeScript framework (npm/elysia, versions 1.4.0 through 1.4.16) allows an unauthenticated remote attacker to merge a __proto__ property into the object prototype through a crafted request body when the application uses a standalone guard whose schema includes an any-typed field. On its own the flaw yields prototype pollution; chained with GHSA-8vch-m3f4-q8jf (arbitrary code injection via unsanitized cookie config in AOT-compiled routes) it can escalate to full remote code execution. Publicly available exploit code exists, but no CISA KEV listing has been observed, and EPSS is low at 0.56% (45th percentile), reflecting the non-default, application-specific configuration required for exploitation.

RemediationAI

Vendor-released patch: upgrade to Elysia 1.4.17 (the version cited as the fix in GHSA-hxj9-33pp-j2cc and delivered by PR https://github.com/elysiajs/elysia/pull/1564, commits 26935bf76ebc43b4a43d48b173fc853de43bb51e and 3af978663e437dccc6c1a2a3aff4b74e1574849e); the GHSA package metadata lists npm/elysia as fixed in 1.4.18, so upgrading to 1.4.18 or later is the safest choice against both advisories. If an immediate upgrade is not possible, the vendor-recommended workaround is to strip the __proto__ key from incoming request bodies before validation or merging, which prevents the pollution primitive but leaves the framework unpatched and requires custom request-handling code that must be maintained and re-verified. Because the full RCE chain depends on the cookie code-injection issue GHSA-8vch-m3f4-q8jf, also sanitize any cookie-related environment input - e.g. escape backticks and ${ sequences in cookie.secrets/cookie.sign values before they reach the Elysia constructor - noting that this is manual escaping that must track future framework changes. The advisory lists AOT compilation (enabled by default) as a precondition for the chained code-injection impact, so disabling AOT may break that second stage, at the cost of the runtime performance and precompilation benefits Elysia's AOT mode provides; prototype pollution alone would still be possible. Regardless of workaround, upgrade to the patched release as the definitive fix, and consult https://github.com/elysiajs/elysia/security/advisories/GHSA-hxj9-33pp-j2cc for the authoritative guidance. Patch status at time of analysis: Patch available per vendor advisory, with fixed versions 1.4.17 (advisory) and 1.4.18 (npm metadata).

Affected Packages

npm elysia fix: 1.4.17

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The root cause is CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes, i.e. prototype pollution) inside Elysia's mergeDeep utility in src/utils.ts. When two standard-schema validation results sharing the same key are deep-merged, the merge ordering can allow a __proto__ key to be written onto the prototype; the condition described by the vendor requires an any type configured as a standalone guard (schema: 'standalone') so that the controlling key survives the merge. Elysia is a TypeScript request-validation/type-inference/OpenAPI framework for Node.js (CPE cpe:2.3:a:elysiajs:elysia:*:*:*:*:*:node.js:*:*), and it compiles route handlers ahead of time (AOT is enabled by default), generating JavaScript source for cookie handling. The related advisory GHSA-8vch-m3f4-q8jf shows that cookie configuration values (for example cookie.secrets provisioned from the environment) are interpolated into that generated code without escaping, so an attacker who can influence those values can inject arbitrary statements into the compiled route; prototype pollution supplies the primitive that lets an attacker reach that sink through request processing rather than only through pre-existing source access. The upstream fix adds ['__proto__', 'constructor', 'prototype'] to the list of keys skipped by mergeDeep and introduces an overrideUnsafeQuote helper that escapes backticks and ${ when emitting cookie config into generated code (commits 26935bf76ebc43b4a43d48b173fc853de43bb51e and 3af978663e437dccc6c1a2a3aff4b74e1574849e). Per the independent assessment (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N), exploitation is not unconditional: the standalone-guard-plus-any-type pattern is non-default and application-specific, and full RCE additionally requires the cookie-config injection prerequisites. The CVSS 4.0 base score of 9.1 (Critical) reflects a network-reachable, unauthenticated flaw (AV:N/PR:N/UI:N) with high confidentiality and integrity impact, while the AT:P metric correctly signals the specific attack requirements.

Know when Elysia gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (github) PRIMARY 9.1 CRITICAL
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
vuln.today AI 7.4 HIGH

Remote unauthenticated request body triggers it (AV:N/PR:N/UI:N), but AC:H reflects the required standalone-guard-with-`any` merge-ordering condition; high confidentiality/integrity via prototype pollution and chained code execution, no availability impact.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

A critical flaw in the Elysia TypeScript framework, used by our Node.js services, lets an external attacker manipulate the underlying object model of a running application and - when chained with a separate known issue in the same framework - achieve full remote code execution on the server. The exposure is concentrated in internet-facing services that rely on standalone guards with loosely typed schema fields, a non-default configuration, which limits the blast radius but not the consequences where it applies. Leadership should care because a successful chain means attacker control of production infrastructure, with the associated risks of data exposure, service outage, and regulatory notification obligations.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.6%
Top 55% exploitable
Prevalence
Low
emerging Bun/TypeScript web framework, limited production deployment footprint
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC Yes
EPSS 0.6%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

67
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +46
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Affected Products (CPE)CVE.org

cpe:2.3:a:elysiajs:elysia:*:*:*:*:*:node.js:*:*

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy