Curl Heap Buffer Overflow via Long Hostname in SOCKS5 Proxy
CVE-2023-38545 Published on October 18, 2023

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.

Github Repository NVD

Vulnerability Analysis

CVE-2023-38545 can be exploited with network access, requires user interaction. This vulnerability is considered to have a low attack complexity. Public availability of a proof of concept (POC) exploit exists for CVE-2023-38545. The potential impact of an exploit of this vulnerability is considered to be very high.

Attack Vector:
NETWORK
Attack Complexity:
LOW
Privileges Required:
NONE
User Interaction:
REQUIRED
Scope:
UNCHANGED
Confidentiality Impact:
HIGH
Integrity Impact:
HIGH
Availability Impact:
HIGH

Weakness Type

What is a Memory Corruption Vulnerability?

The software writes data past the end, or before the beginning, of the intended buffer. Typically, this can result in corruption of data, a crash, or code execution. The software may modify an index or perform pointer arithmetic that references a memory location that is outside of the boundaries of the buffer. A subsequent write operation then produces undefined or unexpected results.

CVE-2023-38545 has been classified to as a Memory Corruption vulnerability or weakness.


Products Associated with CVE-2023-38545

You can be notified by email with stack.watch whenever vulnerabilities like CVE-2023-38545 are published in these products:

 
 
 
 
 
 
 
 
 
 
 
 

Affected Versions

curl:

Vulnerable Packages

The following package name and versions may be associated with CVE-2023-38545

Package Manager Vulnerable Package Versions Fixed In
pip curl-cffi <= 0.6.4 0.7.0b6

Exploit Probability

EPSS
28.33%
Percentile
96.43%

EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.