Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSend HTTP request with legitimate field plus $query___proto__ key
-
DeliveryProxy or BFF forwards raw params object to generated SDK method
-
ExploitextraPrefixes branch strips $query_ prefix, derives __proto__ as slot key
-
ExecutionBracket-write invokes Object.setPrototypeOf on params.query
-
PersistReturned params.query prototype replaced with attacker-controlled object
-
ImpactDownstream for..in or inherited-property check enumerates injected keys
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 | Exploitation requires three concrete conditions to hold simultaneously: (1) the target application forwards user-supplied request parameter objects - including arbitrary or unknown keys - directly into a generated hey-api SDK client method (buildClientParams), a pattern typical of proxy servers, BFF layers, and API gateways; (2) the targeted generated endpoint has at least one registered query parameter field (so that stripEmptySlots does not prune the poisoned params.query slot, which retains at least one own key via the legitimate field); and (3) downstream code within the application either iterates the returned params object with for..in (enumerating inherited keys) or checks inherited properties on it for routing or authorization decisions. Limiting factors: the AC:H CVSS metric correctly reflects that the forwarding-without-sanitization pattern is non-default and must be explicitly present in the application architecture; applications that do not forward user-controlled key names to SDK methods are not reachable; the impact is bounded to the returned slot object and does not pollute global Object.prototype. |
| Impact | The NVD CVSS 3.1 score of 4.8 (AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N) reflects a medium severity rating, with AC:H correctly capturing the non-trivial precondition: the application must act as a forwarding proxy or BFF that passes raw user-supplied key-value pairs into a generated SDK method without sanitization. This substantially narrows the exploitable attack surface relative to a straightforward network-reachable flaw. There is no CISA KEV listing, confirming no confirmed in-the-wild exploitation at time of analysis. However, a functional POC is publicly available in the GitHub advisory, lowering the bar for exploitation once a vulnerable forwarding pattern is identified. The blast radius is bounded - only the local returned params object is affected, not the global Object.prototype - but downstream code using for..in iteration or checking inherited properties for authorization decisions (e.g., isAdmin: true injected via prototype) can be meaningfully impacted. The template-propagation model is a force multiplier: every SDK regenerated from a vulnerable version of @hey-api/openapi-ts carries the flaw, and fixing it requires regeneration, not just patching the generator. EPSS data is not present in the provided intelligence; given AC:H and the specific forwarding precondition, broad automated exploitation appears unlikely. |
| Exploit ScenarioDerived | An attacker sends an HTTP GET request to a proxy or BFF service with query parameters including a legitimate field (e.g., q=hello) and an injected field ($query___proto__={ isAdmin: true }). The proxy forwards the raw parameter object to a generated hey-api SDK method; buildClientParams routes the injected key through the extraPrefixes branch, substituting params.query's prototype with the attacker-supplied object. Downstream authorization logic that checks q.isAdmin via inherited property lookup now returns true, granting unintended privilege escalation. A functional POC reproducing this exact scenario is included in the public GitHub advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 01, 2026
Prototype pollution in @hey-api/openapi-ts affects all versions through 0.97.2, allowing remote unauthenticated attackers to substitute the prototype chain of the returned params slot object by passing a crafted key such as '$query___proto__' through any application that forwards user-supplied parameters to a generated SDK method. The flaw resides in a runtime template (dist/clients/core/params.ts) that is copied verbatim into every generated SDK, meaning every downstream npm package regenerated from this tool carries the vulnerable code - confirmed affected consumers include @opencode-ai/sdk and @trigger.dev/sdk. A functional proof-of-concept is publicly available; exploitation is not confirmed as actively exploited and is absent from CISA KEV.
RemediationAI
No vendor-released patched version has been identified at time of analysis; the fix version is not confirmed in the available data. Consumers should monitor the GitHub advisory at https://github.com/hey-api/openapi-ts/security/advisories/GHSA-hhx9-57xq-r5rw for an official patch release and regenerate all SDKs immediately upon availability, as the fix in the template must propagate to generated code. As an immediate compensating control, any application that forwards user-supplied keys to generated SDK methods should sanitize or allowlist input keys before passing them to buildClientParams - specifically, reject or strip any key where, after prefix removal, the resulting string matches __proto__, constructor, or prototype. Implementing a block at the API gateway or BFF layer to reject request parameters whose keys begin with $ slot prefixes ($query_, $body_, $headers_, $path_) is a coarser but deployable control; note this may break legitimate uses of those prefixes if any exist in the application. Applications that do not forward user-controlled key names to SDK methods are not exploitable and require no immediate action.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in npm, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerability is classified as CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes - Prototype Pollution). The affected code lives in the extraPrefixes branch of buildClientParams in dist/clients/core/params.ts. When a key is not found in the generated field map but starts with one of four slot prefixes ($body_, $headers_, $path_, $query_), the function strips the prefix via key.slice(prefix.length) and performs a direct bracket-write: params[slot][derived_key] = value. Because no sanitization is applied to derived_key, passing '$query___proto__' causes derived_key to equal '__proto__', and the assignment params['query']['__proto__'] = value invokes the JavaScript engine's __proto__ setter, which calls Object.setPrototypeOf(params.query, value). The affected package is identified by CPE pkg:npm/@hey-api_openapi-ts and targets Node.js environments running generated TypeScript/JavaScript SDKs. Notably, global Object.prototype is not modified; the poisoned prototype is scoped to the returned slot object and its consumers.
Know when Docker 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
AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
Network-delivered via crafted HTTP key; AC:H because exploitation requires a non-default proxy/BFF forwarding pattern; PR:N as no authentication is needed from the attacker; S:U because only the local params object is affected, not global prototype.
Primary rating from Vendor (https://github.com/hey-api/openapi-ts).
CVSS VectorVendor: https://github.com/hey-api/openapi-ts
DescriptionCVE.org
Summary
dist/clients/core/params.ts in @hey-api/openapi-ts ships a runtime template that is copied verbatim into every generated SDK as params.gen.ts. When a caller passes an object argument containing an unknown key starting with a slot prefix ($body_, $headers_, $path_, $query_), the function strips the prefix and writes the remainder directly to that slot without validation. The key "$query___proto__" causes the returned params.query object to have its prototype chain substituted with attacker-controlled data. The issue is present in all versions through at least 0.97.2.
Details
The vulnerable branch in dist/clients/core/params.ts:
const extra = extraPrefixes.find(([prefix]) => key.startsWith(prefix))
if (extra) {
const [prefix, slot] = extra
;(params[slot] as Record<string, unknown>)[key.slice(prefix.length)] = value
}This branch runs for any key that (1) is not registered in the field map and (2) starts with one of the four slot prefixes. When a caller passes "$query___proto__" as an extra key alongside a legitimate field, the key is not in the field map, key.startsWith("$query_") is true, and key.slice(7) produces "__proto__". The bracket-write params["query"]["__proto__"] = value invokes the __proto__ setter, which calls Object.setPrototypeOf(params.query, value).
Reachability. Every generated endpoint method that accepts an object argument passes it through buildClientParams. If the application forwards user-supplied request parameters to a generated client method - a common pattern in proxy servers, BFF layers, and API gateways - an attacker can include "$query___proto__" alongside a legitimate field (e.g. "q"). The legitimate field ensures stripEmptySlots does not remove the affected slot (it has at least one own key), so the poisoned params.query object is returned to the caller.
Concrete field config that hey-api generates for a GET endpoint with one query param q:
// generated by hey-api for: GET /search?q=<string>
buildClientParams([parameters], [{ args: [{ in: "query", key: "q" }] }])A request { q: "hello", "$query___proto__": { isAdmin: true } } reaches this call with "q" going to the field map branch and "$query___proto__" falling through to extraPrefixes.
PoC
npm install @hey-api/openapi-ts@0.97.2
cp node_modules/@hey-api/openapi-ts/dist/clients/core/params.ts ./params.ts
npx tsx poc.ts
# or: docker build -t heyapi-poc . && docker run --rm heyapi-pocpoc.ts:
import { buildClientParams } from "./params.ts";
// Generated fields config for GET /search?q=<string>
const generatedFields = [{ args: [{ in: "query" as const, key: "q" }] }];
// Attacker request: legitimate "q" plus injected "$query___proto__"
const result = buildClientParams(
[{ q: "hello", "$query___proto__": { isAdmin: true } }],
generatedFields
);
const q = result.query as any;
console.log(q.q); // "hello" - own property, normal
console.log(q.isAdmin); // true - inherited via prototype chain
console.log(Object.keys(q)); // ["q"] - own keys only
for (const k in result.query) console.log(k); // "q", "isAdmin"Expected output:
[CONFIRMED] buildClientParams prototype substitution via $query___proto__ key
Scenario: GET /search with fields [{ in:'query', key:'q' }]
Attacker request: { q: 'hello', '$query___proto__': { isAdmin: true } }
result.query.q = hello
result.query.isAdmin = true ← inherited, NOT own
Object.keys(q) = [ 'q' ]
for..in keys = q, isAdmin
Object.getPrototypeOf = {"isAdmin":true}No sentinel key is needed. The legitimate field "q" keeps params.query alive through stripEmptySlots. reproduce.zip
Impact
The returned params.query object has its prototype chain substituted with the attacker-supplied value. Any downstream code that iterates it with for..in (e.g., when serializing query parameters for an outgoing HTTP request) will enumerate the injected keys alongside legitimate ones. Applications that check inherited properties on the params object for routing or authorization decisions are also affected.
Global Object.prototype is not modified - impact is limited to the returned slot object and its consumers.
Every npm package generated by @hey-api/openapi-ts carries this template. Downstream packages include @opencode-ai/sdk, @trigger.dev/sdk, and others. A fix in the template propagates to all of them on regeneration.
Blast Radius
ecosystem impact- 15 npm packages depend on @hey-api/openapi-ts (7 direct, 8 indirect)
Ecosystem-wide dependent count for version 0.97.3.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl
runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac
Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post
Path traversal in JFrog Artifactory (CWE-22) enables an authenticated low-privilege user to write data outside the inten
Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build
Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config
Unauthenticated remote command injection in SGWBOX N3 firmware 2.0.25 lets attackers execute arbitrary operating-system
Remote code execution in Flowise before 3.1.2 allows any authenticated user (or API caller with chatflow view/update per
Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l
Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c
EUVD-2026-45267
GHSA-hhx9-57xq-r5rw
NVD
CVE.org
EPSS
Exploit-DB