CVE-2025-15079

5.3 MEDIUM

📋 TL;DR

This vulnerability in libcurl allows SSH-based transfers (SCP/SFTP) to accept connections to hosts not listed in the specified known_hosts file if those hosts exist in the global libssh known_hosts file. This affects applications using libcurl with SSH support and custom known_hosts configurations, potentially enabling man-in-the-middle attacks.

💻 Affected Systems

Products:
  • libcurl
  • Applications using libcurl with SSH support
Versions: libcurl 8.8.0 to 8.9.0
Operating Systems: All operating systems where libcurl with SSH support is used
Default Config Vulnerable: ✅ No
Notes: Only affects configurations where custom known_hosts files are specified via CURLOPT_SSH_KNOWNHOSTS or --known-hosts option.

📦 What is this software?

Curl by Haxx

curl is a command-line tool and library for transferring data with URLs. It supports numerous protocols including HTTP, HTTPS, FTP, and more, making it essential for API testing, web scraping, and automated data transfers.

Learn more about Curl →

⚠️ Risk & Real-World Impact

🔴

Worst Case

Man-in-the-middle attacker intercepts SSH transfers, potentially stealing credentials or sensitive data in transit.

🟠

Likely Case

Attackers could redirect connections to malicious servers, compromising data integrity and confidentiality of SSH transfers.

🟢

If Mitigated

With proper host verification and network segmentation, impact is limited to potential connection redirection within controlled environments.

🌐 Internet-Facing: MEDIUM - SSH transfers to external systems could be intercepted if attackers control network paths.
🏢 Internal Only: LOW - Internal network attacks require compromised internal systems or network access.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires ability to intercept SSH connections and knowledge of target's SSH configuration.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: libcurl 8.10.0

Vendor Advisory: https://curl.se/docs/CVE-2025-15079.html

Restart Required: No

Instructions:

1. Update libcurl to version 8.10.0 or later. 2. Recompile applications using libcurl if statically linked. 3. Restart applications using libcurl.

🔧 Temporary Workarounds

Use strict host key checking

all

Configure libcurl to use strict host key checking and disable fallback to global known_hosts

curl_easy_setopt(curl, CURLOPT_SSH_KNOWNHOSTS, "/path/to/known_hosts");
curl_easy_setopt(curl, CURLOPT_SSH_AUTH_TYPES, CURLSSH_AUTH_PUBLICKEY);

Clear global known_hosts file

linux

Remove or secure the global libssh known_hosts file to prevent fallback

rm ~/.ssh/known_hosts
chmod 600 ~/.ssh/known_hosts

🧯 If You Can't Patch

  • Disable SSH/SCP/SFTP transfers in affected applications
  • Implement network-level controls to restrict SSH connections to trusted hosts only

🔍 How to Verify

Check if Vulnerable:

Check libcurl version and verify if SSH transfers with custom known_hosts are used: curl --version | grep libcurl

Check Version:

curl --version | grep libcurl

Verify Fix Applied:

Confirm libcurl version is 8.10.0 or later and test SSH transfers with invalid known_hosts entries

📡 Detection & Monitoring

Log Indicators:

  • Unexpected SSH connection failures
  • SSH host key verification warnings in application logs

Network Indicators:

  • SSH connections to unexpected IP addresses or hostnames
  • Unusual SSH traffic patterns

SIEM Query:

source="application_logs" AND ("SSH host key" OR "known_hosts") AND ("warning" OR "failure")

🔗 References

📤 Share & Export