CVE-2026-12064: curl SSH Host Verification Bypass with Schemeless URLs
curl has a vulnerability where using a schemeless URL with the `--proto-default` flag set to sftp or scp causes the command-line tool to incorrectly handle SSH security verification. The tool layer fails to initialize critical host verification options, allowing curl to connect to SSH servers without validating their authenticity. This happens because of a mismatch between how the tool interprets the URL and how the underlying libcurl library processes it, resulting in a silent bypass of security checks that should normally occur.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
- Weaknesses (CWE)
- CWE-295
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-07-03 / 2026-07-07
NVD description (verbatim)
When a user invokes curl using a schemeless URL combined with `--proto-default` sftp (or scp), a disconnect occurs between the tool layer and libcurl. The tool layer incorrectly infers the URL scheme, which erroneously bypasses the initialization of critical SSH security options like CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 and CURLOPT_SSH_KNOWNHOSTS. Conversely, the libcurl runtime successfully honors CURLOPT_DEFAULT_PROTOCOL and establishes the connection via SFTP/SCP as specified. Because the tool layer skipped the security configuration, these SSH host verification options are silently omitted, causing curl to connect to an unverified SSH remote host without throwing an error.
4 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
CVE-2026-12064 exploits a disconnect between curl's command-line tool layer and libcurl's runtime behavior when processing schemeless URLs with `--proto-default sftp` or `--proto-default scp`. The tool layer misinterprets the URL scheme and skips initialization of CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 and CURLOPT_SSH_KNOWNHOSTS options. Meanwhile, libcurl correctly honors CURLOPT_DEFAULT_PROTOCOL and establishes the SFTP/SCP connection as intended. The result is an SSH connection without host key verification—no error is raised, leaving the application vulnerable to man-in-the-middle attacks. The vulnerability is classified under CWE-295 (Improper Certificate Validation).
Business impact
An attacker positioned on the network path to an SSH server can intercept curl connections and serve a malicious host key without detection. This is particularly dangerous in automated workflows, CI/CD pipelines, or scripts that use curl for secure file transfer operations. Compromised connections could lead to credential theft, malware injection, or unauthorized data exfiltration. Organizations relying on curl for SFTP/SCP automation should treat this as a high-priority integrity risk.
Affected systems
The vulnerability affects haxx curl. Any system or application using curl versions with this defect and invoking schemeless URLs in combination with `--proto-default sftp` or `--proto-default scp` is at risk. This includes command-line invocations, scripted deployments, and applications that shell out to curl for file transfer operations.
Exploitability
Exploitation requires network-level access to intercept traffic between the client and SSH server (man-in-the-middle position). No user interaction is needed beyond the initial curl invocation with the vulnerable flag combination. The attack is practical in environments where an attacker can control network routing or DNS, such as compromised networks, malicious ISPs, or internal lateral movement scenarios. The CVSS vector (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N) reflects high integrity impact with low complexity and no privileges required.
Remediation
Apply the security update from haxx curl that restores proper SSH host verification initialization in the tool layer when `--proto-default` is used with schemeless URLs. Verify against the official curl advisory for exact patched versions. Until patching is possible, avoid using schemeless URLs with `--proto-default sftp` or `--proto-default scp`; instead, use fully-qualified URLs (e.g., `sftp://host/path`) to ensure the tool layer correctly initializes security options.
Patch guidance
Consult the official haxx curl security advisory for the specific version containing the fix. Update curl to the patched release at your earliest convenience. Test the patched version in a non-production environment first, particularly if curl is embedded in critical automation or file-transfer workflows. Verify that SSH host key verification is now functioning correctly by attempting a connection to an unknown host—curl should now reject it.
Detection guidance
Search logs and scripts for curl invocations using `--proto-default sftp` or `--proto-default scp` in combination with schemeless URLs (those without a scheme prefix like `sftp://`). Monitor for any unexpected SSH connections from curl-based processes, particularly those lacking host key validation warnings or errors. Inspect curl configuration files and automation scripts to identify risky patterns. Endpoint detection tools should flag curl executions with these flag combinations as suspicious.
Why prioritize this
This vulnerability sits at the intersection of silent failure and high-impact attack surface. Unlike many SSH vulnerabilities that raise obvious errors, this one silently bypasses verification, making it easy for adversaries to succeed and hard for defenders to spot. The combination of network-level exploitability, no user interaction required, and integrity-focused impact (perfect for man-in-the-middle attacks) justifies HIGH severity. Organizations automating file transfers or deployments via curl should treat this as an urgent fix.
Risk score, explained
The CVSS 3.1 score of 7.5 (HIGH) reflects: (1) network-accessible attack vector with no special privileges or user interaction needed; (2) high integrity impact—attackers can modify or intercept sensitive files in transit; (3) no confidentiality or availability impact, narrowing the scope. The score appropriately captures the real-world danger of silent SSH verification bypass, though organizations with strict file-transfer SLAs may regard this as even more critical.
Frequently asked questions
Why doesn't curl throw an error when SSH host verification fails?
The tool layer's misinterpretation of the schemeless URL causes it to skip initialization of the SSH verification options altogether. libcurl itself never receives the directives to verify the host key, so there is no mismatch or error to report—the connection proceeds silently. This silent failure is the core danger of the vulnerability.
Is this vulnerability only triggered by command-line usage, or does it affect applications that call curl as a library?
The vulnerability specifically targets curl's command-line tool layer, so it affects direct command-line usage and scripts that invoke the curl binary. Applications using libcurl as a library are not affected if they explicitly set CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 or CURLOPT_SSH_KNOWNHOSTS via the library API. However, tools or wrappers that shell out to the curl binary are at risk.
What's the difference between using a schemeless URL and a fully-qualified URL in curl?
A schemeless URL (e.g., `example.com/file`) forces curl to infer the scheme based on flags like `--proto-default`. A fully-qualified URL (e.g., `sftp://example.com/file`) explicitly tells curl the protocol to use. When you use a fully-qualified SFTP/SCP URL, the tool layer correctly identifies the scheme and initializes SSH verification options, avoiding this vulnerability.
Are there workarounds if I can't patch immediately?
Yes. Refactor any automation that uses `--proto-default sftp` or `--proto-default scp` with schemeless URLs to instead use explicit `sftp://` or `scp://` URLs. Additionally, rely on SSH's own host-key validation mechanisms (e.g., `~/.ssh/known_hosts`) as a secondary check, though this should not replace fixing curl. If curl is used in a controlled, trusted network, the risk is lower, but patching remains strongly recommended.
This analysis is based on publicly available vulnerability data as of the publication date. Patch availability, version numbers, and remediation timelines should be verified against the official haxx curl security advisory. Organizations should conduct their own risk assessment based on their specific curl usage patterns and network environment. This explainer does not constitute security advice for any particular deployment; consult with your security team before implementing changes. Source: NVD (public-domain), retrieved 2026-08-11. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-8286HIGHcurl STARTTLS Connection Reuse Vulnerability (High Severity)
- CVE-2025-71261HIGHSUSE Harvester TLS Handshake Bypass Vulnerability (HIGH)
- CVE-2026-11310HIGHwolfSSL X.509 Certificate Verification Bypass (OpenSSL Extra Mode)
- CVE-2026-11999HIGHwolfSSL X.509 Trust Chain Bypass in OpenSSL Compatibility Mode
- CVE-2026-41859HIGHBOSH nats-sync SSL Certificate Validation Bypass – Credential Theft & Authorization Tampering
- CVE-2026-44393HIGHOpenStack oslo.messaging RabbitMQ TLS Hostname Verification Bypass
- CVE-2026-45170HIGHIdira Vendor PAM TLS Certificate Validation Bypass
- CVE-2026-45175HIGHIdira Endpoint Privilege Manager Agent Improper Access Control (CVSS 7.8)