---
id: CVE-2023-38545
title: |-
  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
  maxi…
summary: |-
  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
  maxi…
severity: high
cvss: 8.8
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'
cvssSource: adp
vendor: curl
product: curl
affected:
  - curl >= 8.4.0 < 8.4.0
ssvc:
  exploitation: poc
  automatable: 'no'
  technicalImpact: total
  timestamp: '2024-10-17T21:11:03.346985Z'
exploitAvailable: true
published: '2023-10-18'
updated: '2026-10-14'
sourceUpdated: '2026-10-14T23:35:01.977Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2023-38545'
references:
  - url: 'https://curl.se/docs/CVE-2023-38545.html'
  - url: 'https://security.netapp.com/advisory/ntap-20231027-0009/'
  - url: >-
      https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OGMXNRNSJ4ETDK6FRNU3J7SABXPWCHSQ/
  - url: >-
      https://www.secpod.com/blog/high-severity-heap-buffer-overflow-vulnerability/
  - url: 'https://support.apple.com/kb/HT214036'
  - url: 'https://support.apple.com/kb/HT214063'
  - url: 'https://support.apple.com/kb/HT214057'
  - url: 'https://support.apple.com/kb/HT214058'
  - url: 'http://seclists.org/fulldisclosure/2024/Jan/34'
  - url: 'http://seclists.org/fulldisclosure/2024/Jan/37'
  - url: 'http://seclists.org/fulldisclosure/2024/Jan/38'
  - url: 'https://security.netapp.com/advisory/ntap-20240201-0005/'
  - url: 'https://forum.vmssoftware.com/viewtopic.php?f=8&t=8868'
tags:
  - cve.org
  - exploit-available
epss: 0.78689
epssPercentile: 0.99587
exploits:
  github: 8
  githubRepos:
    - 'https://github.com/UTsweetyfish/CVE-2023-38545'
    - 'https://github.com/imfht/CVE-2023-38545'
    - >-
      https://github.com/fatmo666/CVE-2023-38545-libcurl-SOCKS5-heap-buffer-overflow
  checkedAt: '2026-10-16T16:15:30.247Z'
ingestedAt: '2026-10-15T04:46:37.293Z'
---

## Overview

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

- `curl >= 8.4.0 < 8.4.0`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
