Skip to main content

hey-api openapi-ts CVE-2026-48819

| EUVDEUVD-2026-45267 MEDIUM
Improperly Controlled Modification of Object Prototype Attributes (Prototype Pollution) (CWE-1321)
2026-07-01 https://github.com/hey-api/openapi-ts GHSA-hhx9-57xq-r5rw
4.8
CVSS 3.1 · Vendor: https://github.com/hey-api/openapi-ts
View

Attack ChainAIDerived

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

  1. Access
    Send HTTP request with legitimate field plus $query___proto__ key
  2. Delivery
    Proxy or BFF forwards raw params object to generated SDK method
  3. Exploit
    extraPrefixes branch strips $query_ prefix, derives __proto__ as slot key
  4. Execution
    Bracket-write invokes Object.setPrototypeOf on params.query
  5. Persist
    Returned params.query prototype replaced with attacker-controlled object
  6. Impact
    Downstream 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.4% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – 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

openapi-ts < 0.97.3

Affected Packages

npm @hey-api/openapi-ts fix: 0.97.3
euvd openapi_ts fix: 0.97.3

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

Vendor (https://github.com/hey-api/openapi-ts) PRIMARY 4.8 MEDIUM
AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
vuln.today AI 4.8 MEDIUM

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.

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

Primary rating from Vendor (https://github.com/hey-api/openapi-ts).

CVSS VectorVendor: https://github.com/hey-api/openapi-ts

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

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:

typescript
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:

typescript
// 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

bash
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-poc

poc.ts:

typescript
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.

Threat Intelligence Overview

EPSS Score
0.4%
Top 73% exploitable
Prevalence
Medium
popular npm OpenAPI SDK generator with named enterprise downstream consumers
Threat Intel
1
1 source
Data Quality
5 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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
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
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

24
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +24
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

More in Docker

View all
CVE-2024-55964 CRITICAL POC
9.8 Mar 26

An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl

CVE-2019-5736 HIGH POC
8.6 Feb 11

runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac

CVE-2023-32077 HIGH POC
7.5 Aug 24

Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2023-5815 HIGH POC
8.1 Nov 22

The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post

CVE-2026-66384 MEDIUM POC
5.3 Aug 12

Path traversal in JFrog Artifactory (CWE-22) enables an authenticated low-privilege user to write data outside the inten

CVE-2014-9357 CRITICAL
10.0 Dec 16

Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build

CVE-2026-52806 CRITICAL POC
9.9 Jun 23

Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config

CVE-2025-14707 HIGH POC
8.9 Dec 15

Unauthenticated remote command injection in SGWBOX N3 firmware 2.0.25 lets attackers execute arbitrary operating-system

CVE-2026-56274 HIGH POC
8.7 Jun 23

Remote code execution in Flowise before 3.1.2 allows any authenticated user (or API caller with chatflow view/update per

CVE-2026-34156 CRITICAL POC
9.9 Mar 30

Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l

CVE-2019-15752 HIGH POC
7.8 Aug 28

Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c

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