Executive brief
A vulnerability in the curl command-line tool allows it to connect to remote servers via SFTP or SCP without verifying the server's identity. This occurs when a user provides a URL without a protocol prefix (like 'example.com' instead of 'sftp://example.com') while using the '--proto-default' setting. An attacker could perform a man-in-the-middle attack to intercept or modify data because the tool fails to check the server's security credentials.
Technical details
A logic error exists in the curl command-line tool layer where it incorrectly infers the URL scheme for schemeless URLs when --proto-default is set to sftp or scp. While libcurl correctly establishes the connection using the intended protocol, the tool layer fails to initialize critical SSH security options, specifically CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 and CURLOPT_SSH_KNOWNHOSTS. This results in the silent omission of host key verification, allowing connections to unverified SSH hosts. This issue affects the curl tool only and does not impact applications using the libcurl library directly.
Affected products
- curl curl 7.81.0 to 8.20.0
Timeline
- 2026-06-12: disclosed: Reported to the curl project via HackerOne
- 2026-06-24: patched: Fixed in curl version 8.21.0
- 2026-06-24: advisory: Project advisory published