/

CVE-2026-45373

Severity:

HIGH RISK

(7.4)

SSRF in CodeWhale Terminal Agent

CVE-2026-45373

Deferred

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Unauthorized access to internal or protected network resources

Severity:

HIGH RISK

(7.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

CodeWhale's HTTP request handling logic insufficiently validates IPv6 literals, allowing requests to localhost-style addresses such as http://[::1] to bypass SSRF defenses.

In environments where CodeWhale can initiate network calls on behalf of a user or agent, this can enable an attacker to coerce the tool into reaching internal services that should not be directly accessible.

Affected context

The vulnerability arises when CodeWhale is used in contexts where:

  • The tool can send HTTP/HTTPS requests to user-specified URLs (e.g., via prompts, configuration, or extensions).
  • SSRF protections rely on hostname resolution checks that treat private or loopback addresses as disallowed.
  • IPv6 literal addresses such as [::1] are not normalized or validated consistently with their hostname equivalents.

Under these conditions, a crafted URL using an IPv6 loopback literal may reach local or internal services that SSRF filters were intended to block.

Exploit preconditions

  • Attack surface: Network requests initiated by CodeWhale, driven by user input, agent instructions, or integrated features that fetch external resources.
  • Required access: Ability to influence or control the URL that CodeWhale fetches (e.g., by providing prompts, configuration, or project files that contain URLs).
  • Trigger point: Submission of a URL using an IPv6 literal (for example, http://[::1]/ or other IPv6 forms) that resolves to loopback or internal resources.
  • Why exploitation is possible: The SSRF validation logic correctly filters hostnames that resolve to private IPv6 addresses but does not equivalently enforce restrictions when the address is specified directly as an IPv6 literal, allowing requests to protected targets such as localhost.

Why this happens

This issue is an SSRF validation gap corresponding to CWE-918: Server-Side Request Forgery.

The core problem is that the URL validation layer focuses on hostnames and their DNS resolution results, but treats IPv6 literal addresses differently, leaving a blind spot for [::1] and potentially other literal forms.

Because the security decision is tied to an incomplete interpretation of the target address—rather than a canonical representation of the actual destination—requests to loopback or internal interfaces can slip past filters.

Abstractly, this reflects a common SSRF anti-pattern: performing allow/deny checks on unnormalized URL components instead of validating the resolved destination endpoint (IP, port, scheme, and interface) in a consistent and comprehensive way.

Potential impact

  • Access to local services bound to loopback interfaces (e.g., http://[::1]:port) that are not otherwise exposed.
  • Interaction with internal HTTP APIs, metadata endpoints, or developer tools reachable from the CodeWhale host.
  • Potential exposure of sensitive configuration data, credentials, or tokens hosted on local services.
  • Use of CodeWhale as a pivot to map or interact with portions of the internal network reachable from the host environment.
  • Facilitation of further attack chains where internal services trust requests originating from localhost.

General mitigation guidance

Effective mitigation typically focuses on canonical, protocol-aware validation of outbound requests and tightening trust boundaries:

  • Normalize and canonicalize all target URLs before enforcement, including proper parsing of IPv4, IPv6 literals (e.g., [::1]), and hostnames.
  • Apply SSRF checks on the resolved destination IP and port, not only on the hostname string, ensuring loopback and private ranges (both IPv4 and IPv6) are consistently blocked where appropriate.
  • Maintain explicit allowlists for external destinations when feasible, instead of attempting to blacklist internal ranges.
  • Segregate the network environment of tools like CodeWhale using firewall rules, container/network namespaces, or proxies that limit access to local and sensitive services.
  • Run CodeWhale with the least network and system privileges necessary, reducing the blast radius of any SSRF-related flaws.

How teams detect issues like this

Organizations can look for this class of issue and its manifestations through:

  • Static analysis and code review:
  • Identify code paths that construct or send HTTP/HTTPS requests based on user-influenced URLs.
  • Check whether SSRF validation logic handles IP literals (including IPv6), hostnames, and DNS results in a unified manner.
  • Flag patterns where only hostname-based blocking (e.g., localhost, 127.0.0.1) is implemented without corresponding IP range checks.
  • Dynamic and integration testing:
  • Add tests that attempt to access loopback and private network resources using IPv6 literals such as http://[::1].
  • Validate that requests to disallowed targets are blocked regardless of how the address is encoded.
  • Operational monitoring:
  • Instrument outbound HTTP traffic from CodeWhale's execution environment and alert on connections to loopback or private addresses.
  • Automated security tools (e.g., SAST, DAST, policy-as-code scanners) can be configured to highlight network call sites and enforce SSRF-safe patterns.

Sources

SourceLink
github.comgithub.com/Hmbown/CodeWhale/security/advisories/GHSA-88gh-2526-gfrr
github.comgithub.com/Hmbown/DeepSeek-TUI/blob/15f62e3e93d842f30b428877819ebc1c8cb96814/crates/tui/src/tools/fetch_url.rs#L321
github.comgithub.com/Hmbown/DeepSeek-TUI/releases/tag/v0.8.26

Frequently asked

questions

It can be, if an attacker can influence the URLs that CodeWhale requests—for example, by controlling prompts, configuration, or project content that drives the tool's network calls. In such setups, an attacker does not need direct network access to the host; they only need to cause CodeWhale to make the request on their behalf.

The attacker must be able to supply or modify URLs that CodeWhale will fetch. This may be through authenticated usage, shared environments, or content that the tool processes automatically. They do not necessarily need shell access or direct network connectivity to internal services.

The most robust approach is to normalize all URLs, resolve them to their destination IP and port, and then enforce a strict allowlist or denylist based on the resolved address—covering both IPv4 and IPv6, hostnames, and literals. This should be combined with network-level controls that prevent tools like CodeWhale from reaching sensitive internal endpoints.

Adopt a defense-in-depth strategy: design features so they minimize arbitrary outbound requests, centralize URL and network validation logic, use canonicalization and resolution-based checks, and enforce network segmentation around development tools. Incorporate SSRF-specific test cases and automated checks into CI pipelines so new URL handling features are evaluated against both IPv4 and IPv6 bypass techniques.

Find out what's already
exploitable in your codebase.