cbcvebase.
CVE-2023-38545
published 2023-10-18

CVE-2023-38545: 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…

PriorityP276critical9.8CVSS 3.1
AVNACLPRNUINSUCHIHAH
EPSS
78.48%
99.5th percentile
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.

Affected

50 ranges· showing 25
VendorProductVersion rangeFixed in
applemacos_monterey
applemacos_sonoma
applemacos_ventura
curlcurl>= 8.4.0 < 8.4.08.4.0
debiancurl< curl 7.88.1-10+deb12u4 (bookworm)curl 7.88.1-10+deb12u4 (bookworm)
fedoraprojectfedora
googlechrome_chrome
haxxcurl>= 0 < 8.4.0-r08.4.0-r0
haxxcurl>= 0 < 8.4.0-r08.4.0-r0
haxxcurl>= 0 < 8.4.0-r08.4.0-r0
haxxcurl>= 0 < 8.4.0-r08.4.0-r0
haxxcurl>= 0 < 8.4.0-r08.4.0-r0
haxxcurl>= 0 < 8.4.0-r08.4.0-r0
haxxcurl>= 0 < 8.4.0-r08.4.0-r0
haxxcurl>= 0 < 8.4.0-r08.4.0-r0
haxxcurl>= 0 < 8.4.0-r08.4.0-r0
haxxcurl>= 0 < 7.74.0-1.3+deb11u107.74.0-1.3+deb11u10
haxxcurl>= 0 < 7.88.1-10+deb12u47.88.1-10+deb12u4
haxxcurl>= 0 < 8.3.0-38.3.0-3
haxxcurl>= 0 < 8.3.0-38.3.0-3
haxxcurl>= 0 < 7.68.0-1ubuntu2.207.68.0-1ubuntu2.20
haxxcurl>= 0 < 7.81.0-1ubuntu1.147.81.0-1ubuntu1.14
haxxcurl>= 0 < 8.2.1-1ubuntu3.18.2.1-1ubuntu3.1
haxxlibcurl>= 7.69.0 < 8.4.08.4.0
microsoftwindows_10_1809< 10.0.17763.512210.0.17763.5122

Detection & IOCsextracted from sources · hover to see the quote

versionlibcurl 7.69.0 to 8.3.0 (vulnerable range)
commandCURLPROXY_SOCKS5_HOSTNAME proxy usage
commandsocks5h:// proxy environment variable
otherHTTP 302 redirect to hostname >255 bytes via SOCKS5 proxy
  • Detect curl/libcurl processes or binaries making outbound connections through a SOCKS5 proxy (socks5h:// or CURLPROXY_SOCKS5_HOSTNAME) — a prerequisite for exploitation.
  • Monitor for curl crashes (heap corruption / SIGSEGV) when a SOCKS5 proxy is in use, which may indicate exploitation attempts resulting in denial-of-service.
  • Alert on HTTP 302 redirects to hostnames exceeding 255 bytes when the client is using a SOCKS5 proxy — this is the trigger condition for the heap overflow.
  • Inventory cloud AI workloads for vulnerable libcurl versions; Tenable found CVE-2023-38545 present in 30% of cloud AI workloads.
  • Use file-system scanning scripts to detect libcurl versions 7.69.0–8.3.0 on Linux hosts (Qualys CAR script library provides a ready-made detection script).
  • Flag slow SOCKS5 handshakes combined with oversized hostnames as a timing-dependent exploitation indicator.
  • ·Exploitation requires curl/libcurl to be explicitly configured to use a SOCKS5 proxy (CURLPROXY_SOCKS5_HOSTNAME or socks5h://); users not routing through SOCKS5 are not affected.
  • ·Automatic redirections must also be enabled in curl for the attack path to be reachable.
  • ·On Windows, manually patching curl can disrupt the Windows update mechanism; wait for an official Microsoft patch instead.
  • ·Current public PoC exploits only achieve denial-of-service (crash); RCE has not been demonstrated, though more sophisticated exploits may emerge.
  • ·The vulnerability is in a shared library (libcurl), so any application embedding its own copy of libcurl 7.69.0–8.3.0 is independently vulnerable and requires its own patch.

CVSS provenance

nvdv3.19.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
ghsa9.8CRITICAL
osv9.8CRITICAL
vendor_cisco9.8CRITICAL
vendor_debian9.8CRITICAL
vendor_msrc9.8HIGH
vendor_oracle9.8CRITICAL
vendor_redhat9.8CRITICAL
vendor_ubuntu9.8CRITICAL
Stop checking back — get the weekly exploitation signal.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.