# CVE-2023-38545: Memory corruption in curl

> A heap-based buffer overflow in curl's SOCKS5 proxy handshake allows attackers to execute arbitrary code or cause denial of service via a long hostname.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 18 Oct 2023
- **Updated:** 14 Oct 2026
- **Also known as:** ALPINE-CVE-2023-38545, AZL-31288, AZL-31501, AZL-34612, AZL-37886, BELL-CVE-2023-38545, CLEANSTART-2026-KI48039, CURL-CVE-2023-38545, DEBIAN-CVE-2023-38545, ECHO-6203-e93c-befd, GHSA-7xw9-w465-6x42, JLSEC-2025-34, RHSA-2024:2011, UBUNTU-CVE-2023-38545, openSUSE-SU-2024:13461-1, openSUSE-SU-2024:13464-1, openSUSE-SU-2024:14085-1

## What is CVE-2023-38545?

CVE-2023-38545 is a high-severity memory corruption vulnerability in Fedoraproject Fedora, published on 18 Oct 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official 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.

Weakness: CWE-787 (Out-of-bounds Write)

## Which versions are affected by CVE-2023-38545?

It affects 13 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `puppet-agent` | Red Hat:rhel_satellite_client:6::el6 | All versions | 0:7.27.0-1.el6sat |
| `puppet-agent` | Red Hat:rhel_satellite_client:6::el7 | All versions | 0:7.27.0-1.el7sat |
| `puppet-agent` | Red Hat:rhel_satellite_client:6::el8 | All versions | 0:7.27.0-1.el8sat |
| `puppet-agent` | Red Hat:rhel_satellite_client:6::el9 | All versions | 0:7.27.0-1.el9sat |
| `cmake` | openSUSE:Tumbleweed | All versions | 3.27.8-1.1 |

Products: Fedoraproject Fedora, Haxx Libcurl, Microsoft Windows 10 1809, Microsoft Windows 10 21h2, Microsoft Windows 10 22h2, Microsoft Windows 11 21h2, Microsoft Windows 11 22h2, Microsoft Windows 11 23h2, Microsoft Windows Server 2019, Microsoft Windows Server 2022, Netapp Active Iq Unified Manager, Netapp Oncommand Insight, Netapp Oncommand Workflow Automation.

## How do I fix CVE-2023-38545?

Upgrade to a fixed version.

## Is CVE-2023-38545 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-38545 exists.

Public exploit code:

- This script is designed to exploit a heap buffer overflow vulnerability in a socks5 proxy server. (github_poc): https://github.com/d0rb/CVE-2023-38545
- Simple PoC causing overflow (github_poc): https://github.com/UTsweetyfish/CVE-2023-38545
- 😄 CVE-2023-38545堆溢出的POC和分析文章 (github_poc): https://github.com/imfht/CVE-2023-38545
- Simple PoC causing overflow (github_poc): https://github.com/fatmo666/CVE-2023-38545-libcurl-SOCKS5-heap-buffer-overflow
- A proof of concept for testing CVE-2023-38545 against local curl (github_poc): https://github.com/bcdannyboy/CVE-2023-38545
- Dockerfile containing all the necessary setup files to demo the exploit  (github_poc): https://github.com/vanigori/CVE-2023-38545-sample

## Other vulnerabilities in Fedoraproject Fedora

- [CVE-2024-4577](https://insights.sbomify.com/CVE-2024-4577/): PHP-CGI OS Command Injection (critical 9.8, exploited in the wild)
- [CVE-2021-39226](https://insights.sbomify.com/CVE-2021-39226/): Grafana Authentication Bypass (critical 9.8, exploited in the wild)
- [CVE-2019-5544](https://insights.sbomify.com/CVE-2019-5544/): VMware ESXi and Horizon DaaS OpenSLP Heap-Based Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2024-4947](https://insights.sbomify.com/CVE-2024-4947/): Google Chromium V8 Type Confusion (critical 9.6, exploited in the wild)
- [CVE-2024-4671](https://insights.sbomify.com/CVE-2024-4671/): Google Chromium Visuals Use-After-Free (critical 9.6, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-38545 and fix it if it is affected.

What it is: CVE-2023-38545 is a high-severity memory corruption vulnerability in Fedoraproject Fedora, published on 18 Oct 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-38545 exists.

Affected product: Fedoraproject Fedora. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-38545/ (Markdown: https://insights.sbomify.com/CVE-2023-38545/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-38545
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-38545
- OSV: https://osv.dev/vulnerability/CVE-2023-38545

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-38545/
Summaries are generated and may contain mistakes; the official description above is the record.
