Repository navigation
SSRF via degraded public-address validation in @deepseek-ai/dsh-web-fetch-http 0.1.5-alpha.1 when an HTTP(S) proxy is configured
#6019
Replies: 1 comment
|
@rockmelodies thanks for the detailed write-up β the source references check out on current master ( Confirmed
Why the proxied path is unvalidated β and where the report is right anyway The comment above
Fix shape β a veto, not a pin, scoped to the no-trust-domain case The blanket fix 1 (resolve-validate every proxied origin) reverses an encoded contract (
One expectation to set: all of these change the contract encoded in Verdict: core network layer of web-fetch-http β not addressable from a plugin (the guard lives inside the provider's network internals; no plugin seam can re-insert validation without replacing the provider). Solid report: source citations accurate, and the CVSS preconditions are honestly stated. |
Uh oh!
There was an error while loading. Please reload this page.
1. Product Introduction
DeepSeek Harness (
dsh) is an open-source AI coding-agent harness developed by DeepSeek AI, built on an "everything-is-a-plugin" Cordis architecture. It lets a large language model execute commands, read/write files, browse the web, and invoke tools to assist with software development, launched viadsh web(GUI) or headless. Its web capability (web_fetch/web_searchtools) is provided by the@deepseek-ai/dsh-web-fetch-httppackage. The vulnerability resides in that package's SSRF guard on the HTTP(S)-proxy path.2. Vulnerability Title
SSRF via degraded public-address validation in
@deepseek-ai/dsh-web-fetch-http0.1.5-alpha.1 when an HTTP(S) proxy is configured3. Summary / Description
@deepseek-ai/dsh-web-fetch-http0.1.5-alpha.1 is affected by a server-side request forgery (SSRF) weakness in itsrequestOncepath. When a proxy route is active, the request is dispatched throughrequestViaand skipsresolvePublicAddresses, leaving onlyisNonPublicIpLiteral(literal-IP rejection) as protection. An attacker β via indirect prompt injection or by steering the model to callweb_fetchβ can supply a hostname that resolves to an internal or cloud-metadata address (e.g.metadata.google.internal,admin.internal.corp,169.254.169.254.nip.io), which the proxy resolves and connects to, bypassing the public-address enforcement that the direct path would have applied. This results in a confidentiality impact (reading internal services / cloud metadata).4. Technical Analysis / Root Cause
Weakness: CWE-918 Server-Side Request Forgery
Data flow / trigger path:
Code location:
File: packages/web/web-fetch-http/src/provider.ts Line: 134-139 Relevant code: const route = proxyRouteFor(url) if (route.proxied && !isNonPublicIpLiteral(url.hostname)) { return await publicHttpNetwork.requestVia(route.dispatcher, url, headers, signal) } const addresses = await this.resolveAddresses(url.hostname, signal) return await publicHttpNetwork.request(url, addresses, headers, signal) File: packages/web/web-fetch-http/src/network.ts Line: 171-174 Relevant code (the only remaining protection, literal IPs only): export function isNonPublicIpLiteral(hostname: string): boolean { const unbracketed = stripIpv6Brackets(hostname) return isIP(unbracketed) !== 0 && !isPublicIpAddress(unbracketed) }Root cause: The direct-path defense is address-based:
resolvePublicAddressesresolves the hostname once and rejects the whole answer set if any address is not global unicast, then the connection is pinned to those validated addresses (DNS-rebinding resistant). On the proxied path, the proxy performs DNS so there is no local address to validate, and the code skips validation entirely β the guarantee silently degrades from "public-address enforcement" to "literal-IP-only". The weakening is silent (no warning, no allow-list); the code comments acknowledge the trade-off but do not surface the residual risk to operators.5. Affected Versions
6. Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:NCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N7. CVSS Vector
8. Reproduction Steps
8.1 Environment
8.2 Steps
Step 1 β Set up the environment
Launch with a forward proxy (enterprise/CI, or Clash/mitmproxy/Burp):
Step 2 β Craft the malicious request
In a session, make the model (or exploit indirect prompt injection from a fetched page) issue a
web_fetchrequest to a hostname (not an IP literal) that resolves to an internal/metadata address:Step 3 β Trigger and observe
isNonPublicIpLiteral(hostname)returnsfalsefor a hostname, so the request is dispatched to the proxy, which resolves and connects to the internal address and returns the internal response.Step 4 β Verify impact (optional)
If the proxy reaches cloud metadata (169.254.169.254), temporary cloud credentials are readable; if it reaches the internal CIDR, internal admin panels/APIs are readable.
9. Proof of Concept
9.1 Usage
9.2 POC Code (conceptual, non-weaponized; follows the source path)
9.3 Expected output / success criteria
The request returns the internal service's response instead of
WEB_BLOCKED_URL;publicHttpNetwork.resolveis never called (consistent with the official test).10. Mitigation / Fix Recommendations
10.1 Temporary mitigations
web_fetchon the default no-proxy deployment; if a proxy is required, add egress allow-listing at the proxy.10.2 Root-cause fixes
resolvePublicAddresseson the proxied path as well (resolve-validate every origin not explicitly exempted byNO_PROXY; only route explicitly-exempt origins through the proxy).installProxyFromEnvironment, warn that enabling a proxy degradesweb_fetchpublic-address enforcement to literal-IP-only, and support a configurable allow-list of proxy-resolvable origins.10.3 Verification
After the fix,
http://metadata.google.internal/(etc.) must still be rejected byresolvePublicAddresses(WEB_BLOCKED_URL) even with a proxy configured, andresolvemust be observed to run.All reactions