Vulnerability record · CVE-2023-38545 · published 18 October 2023
CVE-2023-38545: curl SOCKS5 proxy handshake heap buffer overflow
Haxx · Libcurl
curl contains a heap-based out-of-bounds write (CWE-787) in the SOCKS5 proxy handshake. When a host name longer than 255 bytes is passed for proxy-side resolution, a state variable can take the wrong value during a slow handshake, causing the oversized host name to be copied into a heap buffer instead of the resolved address. The flaw is remotely reachable and can corrupt heap memory.
Description
This flaw makes curl overflow a heap based buffer in the SOCKS5 proxy handshake. When curl is asked to pass along the host name to the SOCKS5 proxy to allow that to resolve the address instead of it getting done by curl itself, the maximum length that host name can be is 255 bytes. If the host name is detected to be longer, curl switches to local name resolving and instead passes on the resolved address only. Due to this bug, the local variable that means "let the host resolve the name" could get the wrong value during a slow SOCKS5 handshake, and contrary to the intention, copy the too long host name to the target buffer instead of copying just the resolved address there. The target buffer being a heap based buffer, and the host name coming from the URL that curl has been told to operate with.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Automated analysis
critical priorityCVSS 9.8 critical with network reachability, no privileges or user interaction, and very high EPSS, though no KEV listing or confirmed exploitation.
What it is
curl contains a heap-based out-of-bounds write (CWE-787) in the SOCKS5 proxy handshake. When a host name longer than 255 bytes is passed for proxy-side resolution, a state variable can take the wrong value during a slow handshake, causing the oversized host name to be copied into a heap buffer instead of the resolved address. The flaw is remotely reachable and can corrupt heap memory.
Impact
An attacker can trigger an out-of-bounds heap write, potentially leading to memory corruption, a crash, or code execution in the context of the process using libcurl. The CVSS vector rates confidentiality, integrity, and availability impact as high.
Attack surface
Reached over the network (AV:N) with no privileges (PR:N) and no user interaction (UI:N) per the CVSS vector. Exploitation requires curl to be configured to use a SOCKS5 proxy with remote name resolution and to process an attacker-influenced URL containing an overlong host name.
Exploitation
Not listed in CISA KEV and no ransomware associations are documented. EPSS is very high (0.78483, 99.563rd percentile), and references include patch and third-party advisories, indicating active attention but no confirmed in-the-wild exploitation in this record.
What to do
- Upgrade curl/libcurl to a version containing the fix referenced in the curl.se advisory (patch first).
- Update or patch downstream products that bundle libcurl, including Fedora, NetApp, Microsoft Windows, and Apple components listed in vendor advisories.
- Avoid using SOCKS5 proxy remote name resolution where possible; prefer local name resolution to reduce exposure.
- Limit or sanitize untrusted URLs passed to curl/libcurl, especially host names exceeding 255 bytes.
- Monitor vendor advisories for updated packages and apply them as they become available.
Detection
- Monitor for curl/libcurl crashes or heap corruption events in applications using SOCKS5 proxies.
- Inspect network traffic for SOCKS5 handshakes carrying unusually long host names (over 255 bytes).
- Audit application logs for URLs with overlong host names processed through curl with proxy resolution enabled.
- Track process crashes or abnormal memory errors in services that embed libcurl.
This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.
Affected products
13 vulnerable configurations from NVD's CPE data, grouped by vendor and product.
References
Track CVE-2023-38545 inside VULONE
Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.
Related vulnerabilities
Same products first, then exploited flaws of the same weakness class.
Source: NIST National Vulnerability Database (record CVE-2023-38545), CISA KEV, FIRST EPSS (scores of 2026-09-24). This page is refreshed as NVD updates the record.