PortGate

Advisories · Linux & SSH

CVE-2023-38545 Critical CVSS 9.8

curl SOCKS5 heap buffer overflow

Disclosed 2023 · Last reviewed 2 Dec 2026

A heap buffer overflow in the SOCKS5 handshake could crash curl or run attacker-controlled data. Typical HTTPS requests that do not use a SOCKS5 proxy do not hit this bug.

What happened

The SOCKS5 code copied a hostname into a fixed buffer during a fallback handshake. A long hostname could write past that buffer.

Affected and patched versions

Affected
curl and libcurl 7.69.0 through 8.3.0 when a SOCKS5 proxy is used and the hostname is long enough to trigger the slow path.
Patched
curl 8.4.0 and later.

How to check your server

Check

curl --version

How to fix and harden

  1. Read the first line of curl --version.
  2. Upgrade curl and libcurl together to 8.4.0 or later from the distribution repository.
  3. Restart long-running services that link libcurl, including PHP-FPM and workers.
  4. SOCKS5 use is the exposed configuration. Upgrading is still the fix.

Fix

sudo apt-get update && sudo apt-get install --only-upgrade curl libcurl4
curl --version

Sources

Version ranges and fixes follow the vendor advisory. When a distribution backports a fix, trust its security tracker over the upstream version number. New advisories: RSS · JSON