CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-75856

CVE-2026-75856: Server-Side Request Forgery (SSRF) Bypass via DNS Resolution TOCTOU in CodeWhale

Amit Schendel
Amit Schendel
Senior Security Researcher

Sep 5, 2026·6 min read·23 visits

Executive Summary (TL;DR)

A Time-of-Check to Time-of-Use (TOCTOU) flaw in CodeWhale's DNS validation logic allows unauthenticated attackers to bypass SSRF protections by intentionally failing the initial DNS resolution and resolving to a restricted IP during the subsequent HTTP request.

A critical Server-Side Request Forgery (SSRF) bypass vulnerability exists in CodeWhale before version 0.8.64 (and version 0.8.41 in the 0.8.x branch) due to a Time-of-Check to Time-of-Use (TOCTOU) bug in its DNS pre-flight validation mechanism. By returning a temporary resolution failure during validation and subsequently resolving to restricted IPs during HTTP execution, attackers can bypass security rules.

Vulnerability Overview

CodeWhale, an application developed by Hmbown, includes features to fetch remote content using URLs provided by users. To secure these features, CodeWhale implements a DNS pinning and pre-flight validation mechanism designed to prevent Server-Side Request Forgery (SSRF) attacks. The intended design checks hostnames prior to initiating external HTTP connections, validating their resolved IP addresses against local network restriction policies.

However, before version 0.8.64 (and version 0.8.41 in the legacy branch), the validation engine contained a severe logical flaw in its handling of pre-flight DNS resolution failures. Specifically, if the initial DNS resolution failed, the application silently ignored the failure and permitted the subsequent HTTP connection to proceed. This omission transforms the validation logic into a classic Time-of-Check to Time-of-Use (TOCTOU) vulnerability.

An attacker can exploit this behavior to bypass local network policies. By orchestrating a DNS configuration that fails during the validation check but succeeds during the actual fetch operation, the attacker can force the CodeWhale server to establish connections to internal loopback addresses, local network services, or cloud infrastructure metadata endpoints.

Root Cause Analysis

The vulnerability resides in crates/tui/src/tools/fetch_url.rs within the validate_fetch_target function. When validating a destination host, the function attempts to perform a DNS lookup using tokio::net::lookup_host. The underlying implementation is designed to verify that the target IP does not resolve to local loopback ranges, link-local addresses, or private subnets defined in the network policy.

If the DNS resolution succeeds, the application validates the returned IP addresses. If the DNS lookup fails and returns an error (such as std::io::ErrorKind::TimedOut or a temporary server failure), the original code caught the error but failed to abort the transaction. Instead, the function assumed that any hostname failing resolution during the check phase would inevitably fail during the actual request execution phase.

This assumption is fundamentally flawed. An attacker can control the DNS server authoritative for the target domain and respond differently during the pre-flight check and the actual HTTP request. By intentionally triggering a DNS resolution failure (such as returning SERVFAIL or dropping the query) during the validation check, the attacker coaxes the validation function into returning Ok(None), effectively bypassing all security checks.

Code Analysis & Diffs

Let us review the vulnerable implementation compared to the patch introduced in commit 26de44a8bd5051f8f944ea60b2c37ae1d2b7d25e. In the vulnerable code path, the DNS lookup was wrapped inside an if let Ok(addrs) pattern. If lookup_host returned an Err, the entire block was skipped, and Ok(first_valid.map(...)) returned Ok(None), bypassing validation.

// Pre-patch vulnerable implementation logic
let mut first_valid: Option<std::net::IpAddr> = None;
if let Ok(addrs) = tokio::net::lookup_host((host.as_str(), 0u16)).await {
    for addr in addrs {
        validate_dns_resolved_ip(&host, &addr.ip(), context.network_policy.as_ref())?;
        if first_valid.is_none() {
            first_valid = Some(addr.ip());
        }
    }
}
// If DNS resolution fails, the HTTP request was allowed to proceed
Ok(first_valid.map(|validated_ip| (host, validated_ip)))

The patch explicitly changes this behavior. The lookup_host call is now chained with .map_err to immediately elevate any resolution failure to a ToolError::permission_denied error, aborting the execution. Furthermore, the patched code enforces that if no addresses are returned, the execution is terminated.

// Patched implementation in crates/tui/src/tools/fetch_url.rs
let addrs = tokio::net::lookup_host((host.as_str(), 0u16))
    .await
    .map_err(|e| {
        ToolError::permission_denied(format!(
            "could not resolve host before fetch_url request: {e}"
        ))
    })?;
let mut first_valid: Option<std::net::IpAddr> = None;
for addr in addrs {
    validate_dns_resolved_ip(&host, &addr.ip(), context.network_policy.as_ref())?;
    if first_valid.is_none() {
        first_valid = Some(addr.ip());
    }
}
 
let Some(validated_ip) = first_valid else {
    return Err(ToolError::permission_denied(
        "host resolved to no addresses before fetch_url request",
    ));
};
Ok(Some((host, validated_ip)))

While this patch successfully addresses the immediate TOCTOU bypass of a failing check, a sophisticated attacker could still leverage DNS Rebinding with short TTLs (Time-To-Live) if the HTTP client library conducts its own independent DNS resolution without using the pinned IP address retrieved during the pre-flight phase. Comprehensive mitigation requires pinning the resolved IP at the socket layer.

Exploitation Methodology

Exploiting this vulnerability requires the attacker to control the authoritative DNS server for a domain (e.g., ssrf.attacker.com) and a configuration that returns stateful responses. The attacker schedules the DNS server to behave differently across consecutive queries or implements a temporary denial-of-service/error state.

In step one, the attacker submits an API request to CodeWhale to fetch https://ssrf.attacker.com/metadata. CodeWhale executes the pre-flight validator, which queries ssrf.attacker.com. The attacker's DNS server drops the request or returns SERVFAIL. The validator catches the error, assumes the host is unresolvable, and permits the connection.

In step two, the HTTP client (reqwest) executes the actual GET request. It resolves ssrf.attacker.com once more. This time, the attacker's DNS server returns a valid local address, such as 127.0.0.1 or the AWS metadata endpoint 169.254.169.254. The HTTP client establishes a connection to the internal endpoint, completely bypassing the SSRF filters.

Impact Assessment

The security implications of an SSRF bypass of this nature are severe. An attacker can leverage the CodeWhale server as an entry point to scan the internal network, access internal APIs, and query local microservices that rely on network perimeter security for authentication.

In cloud environments, this vulnerability permits the retrieval of highly sensitive metadata, such as temporary IAM credentials from the Instance Metadata Service (IMDSv1) at 169.254.169.254. The vulnerability received a CVSS v4.0 base score of 9.2 (Critical), indicating high confidential impact on both the immediate system and subsequent systems (VC:H, SC:H) without requiring user interaction or elevated privileges.

Because the DNS resolution check failed silently, standard application logs would not easily capture the bypass attempt, making detection via basic request logging difficult without specialized network monitoring or DNS queries inspection.

Additional Security Hardenings & Remediation

Beyond resolving the TOCTOU SSRF flaw, commit 26de44a8bd5051f8f944ea60b2c37ae1d2b7d25e introduced critical security upgrades to protect local system boundaries. First, the image_analyze tool was hardened against directory traversal via symbolic links. The application previously verified paths syntactically but did not validate the resolution of symbolic links. The patch canonicalizes paths to ensure they stay within the workspace.

Second, the JavaScript execution tool was modified to prevent child scripts from inheriting the parent process's environment variables. This prevents execution containers from reading and leaking sensitive infrastructure secrets, such as API tokens. Users must upgrade to CodeWhale version 0.8.64 (or 0.8.41 on the older branch) to apply these fixes.

If upgrading is delayed, network-level egress filters should be implemented. Firewalls or container network policies must block the CodeWhale process from establishing connections to loopback addresses, private IP ranges (RFC 1918), and cloud metadata endpoints.

Fix Analysis (1)

Technical Appendix

CVSS Score
9.2/ 10
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N
EPSS Probability
0.37%
Top 70% most exploited

Affected Systems

CodeWhale

Affected Versions Detail

Product
Affected Versions
Fixed Version
CodeWhale
Hmbown
>= 0.8.5, < 0.8.410.8.41
CodeWhale
Hmbown
>= 0.8.41, < 0.8.640.8.64
AttributeDetail
CWE IDCWE-918: Server-Side Request Forgery (SSRF)
Attack VectorNetwork
CVSS v4.0 Score9.2 (Critical)
EPSS Score0.0037 (Percentile: 30.08%)
ImpactHigh Confidentiality Breach
Exploit StatusProof-of-Concept in tests; no weaponized exploits
KEV StatusNot listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1005Data from Local System
Collection
CWE-918
Server-Side Request Forgery (SSRF)

The web application fetches a resource without sufficiently validating the destination URI, allowing an attacker to coerce the server into sending requests to restricted internal network endpoints.

Vulnerability Timeline

Vulnerability patched by developer Hunter B in commit 26de44a8bd5051f8f944ea60b2c37ae1d2b7d25e
2026-06-21
CVE-2026-75856 published and GHSA-6v2g-fpxh-pmmh security advisory released
2026-08-18

References & Sources

  • [1]NVD CVE-2026-75856 Detail
  • [2]CVE Org Authoritative Record
  • [3]Official Security Advisory (GHSA)
  • [4]Patch Commit on GitHub
  • [5]VulnCheck Third-Party Advisory

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 24 hours ago•CVE-2026-107844
5.3

CVE-2026-107844: Path Traversal Vulnerability in Contao ImagesController

A path traversal vulnerability (CWE-22) in Contao CMS allows unauthenticated remote attackers to bypass directory boundary restrictions in ImagesController and access files within the project directory.

Amit Schendel
Amit Schendel
8 views•5 min read
•1 day ago•CVE-2026-107848
3.5

CVE-2026-107848: Cross-Site Request Forgery (CSRF) in Contao Backend Actions via GET Requests

Contao Open Source CMS versions 4.0.0 through 5.3.49 and 5.4.0-RC1 through 5.7.11 contain a Cross-Site Request Forgery (CSRF) vulnerability in backend parameter handling. The `RequestTokenListener` component validates anti-CSRF tokens solely for HTTP POST requests, while GET-based declarative guards run only when an `act` parameter is present in the query string. Consequently, custom backend actions dispatched via alternative parameters such as `key=` can execute without CSRF token verification when triggered by an authenticated user.

Amit Schendel
Amit Schendel
7 views•5 min read
•1 day ago•CVE-2026-107843
5.3

CVE-2026-107843: Unthrottled Activation Email Resend and Account Enumeration in Contao CMS

Contao CMS versions 4.1.0 through 5.3.49 and 5.4.0-RC1 through 5.7.11 fail to validate form submission tokens and enforce rate limiting when processing activation email resend requests via HTTP POST, enabling resource exhaustion and account state enumeration.

Amit Schendel
Amit Schendel
8 views•4 min read
•1 day ago•CVE-2026-107842
5.3

CVE-2026-107842: Information Disclosure via Stale Indexing in Contao Search Module

An information disclosure vulnerability in Contao CMS allows unauthenticated site visitors to view protected page titles, URLs, and text excerpts through search queries when protected page indexing is disabled after previously being enabled.

Amit Schendel
Amit Schendel
10 views•4 min read
•1 day ago•GHSA-G38J-7V97-X298
6.5

GHSA-G38J-7V97-X298: Missing Authorization Check in Vikunja CalDAV Task Relation Creation

In Vikunja prior to version 2.6.0, relation creation via the CalDAV endpoint fails to invoke the TaskRelation.CanCreate authorization check. This missing access control allows an authenticated user to establish unauthorized relationships and perform write operations against any task, provided its unique identifier (UID) is known.

Alon Barad
Alon Barad
12 views•5 min read
•1 day ago•GHSA-3HC7-R24J-RPWC
6.8

GHSA-3hc7-r24j-rpwc: Cross-Project Task Disclosure via Subtask Expansion in Vikunja

A cross-project information disclosure vulnerability in Vikunja allows authenticated users with read access to one project to view private task details from unauthorized projects via subtask expansion parameters.

Alon Barad
Alon Barad
9 views•5 min read