CVE-2022-27782

7.5 HIGH

📋 TL;DR

libcurl incorrectly reuses TLS/SSH connections when security settings have changed, potentially allowing sensitive data to be transmitted over less secure connections. This affects any application using vulnerable libcurl versions for HTTPS or SSH transfers.

💻 Affected Systems

Products:
  • libcurl
  • curl
  • applications using libcurl
Versions: libcurl 7.16.0 through 7.83.0
Operating Systems: All operating systems using affected libcurl versions
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications that change TLS/SSH options between requests while reusing connections.

📦 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

Sensitive data transmitted over downgraded or misconfigured TLS/SSH connections, leading to interception or man-in-the-middle attacks.

🟠

Likely Case

Accidental data leakage when applications change security settings between requests but connections are incorrectly reused.

🟢

If Mitigated

Minimal impact with proper network segmentation and monitoring of connection security parameters.

🌐 Internet-Facing: MEDIUM - Requires specific conditions where security settings change between requests to internet services.
🏢 Internal Only: LOW - Internal network threats are less likely to exploit this specific connection reuse issue.

🎯 Exploit Status

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

Exploitation requires control over TLS/SSH configuration changes between requests and ability to intercept connections.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: libcurl 7.83.1

Vendor Advisory: https://curl.se/docs/CVE-2022-27782.html

Restart Required: Yes

Instructions:

1. Update libcurl to version 7.83.1 or later. 2. Recompile applications using libcurl. 3. Restart affected services.

🔧 Temporary Workarounds

Disable connection reuse

all

Prevent libcurl from reusing connections entirely

curl_easy_setopt(curl, CURLOPT_FORBID_REUSE, 1L)

Force new connections

all

Close connections after each request

curl_easy_setopt(curl, CURLOPT_FRESH_CONNECT, 1L)

🧯 If You Can't Patch

  • Monitor for unexpected TLS/SSH connection downgrades
  • Implement network segmentation to limit exposure

🔍 How to Verify

Check if Vulnerable:

Check libcurl version: curl --version | head -1

Check Version:

curl --version | head -1

Verify Fix Applied:

Verify version is 7.83.1 or higher: curl --version | grep -E '^curl 7\.(8[3-9]|[9-9][0-9])'

📡 Detection & Monitoring

Log Indicators:

  • Unexpected TLS version changes between requests
  • SSH connection parameter mismatches

Network Indicators:

  • TLS/SSL handshake anomalies for reused connections
  • Inconsistent cipher suite usage

SIEM Query:

source="*curl*" AND ("TLS" OR "SSL") AND "reuse" AND "mismatch"

🔗 References

📤 Share & Export