SOCKS5 heap buffer overflow
This flaw makes curl overflow a heap based buffer in the SOCKS5 proxy handshake. When curl is asked to pass along the hostname to the SOCKS5 proxy to allow that to resolve the address instead of it getting done by curl itself, the maximum length that hostname can be is 255 bytes. If the hostname is detected to be longer than 255 bytes, curl switches to local name resolving and instead passes on the resolved address only to the proxy. Due to a 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 hostname to the target buffer instead of copying only the resolved address there.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2023-38545
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 1 Nov 2026, 09:37 UTC · Revision 1
Source evidence
This flaw makes curl overflow a heap based buffer in the SOCKS5 proxy handshake. When curl is asked to pass along the hostname to the SOCKS5 proxy to allow that to resolve the address instead of it getting done by curl itself, the maximum length that hostname can be is 255 bytes. If the hostname is detected to be longer than 255 bytes, curl switches to local name resolving and instead passes on the resolved address only to the proxy. Due to a 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 hostname to the target buffer instead of copying only the resolved address there.
osv:CURL-CVE-2023-38545
Complete source record
{
"id": "df88d314fbd7c2c031757c5d101f16da3313f27ddfc04985addc6fb1ba18bf46",
"url": "https://osv.dev/vulnerability/CURL-CVE-2023-38545",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "SOCKS5 heap buffer overflow",
"summary": "This flaw makes curl overflow a heap based buffer in the SOCKS5 proxy handshake. When curl is asked to pass along the hostname to the SOCKS5 proxy to allow that to resolve the address instead of it getting done by curl itself, the maximum length that hostname can be is 255 bytes. If the hostname is detected to be longer than 255 bytes, curl switches to local name resolving and instead passes on the resolved address only to the proxy. Due to a 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 hostname to the target buffer instead of copying only the resolved address there.",
"evidence": "osv:CURL-CVE-2023-38545",
"products": [],
"severity": "high",
"structured": {
"id": "CURL-CVE-2023-38545",
"aliases": [
"CURL-CVE-2023-38545",
"CVE-2023-38545"
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "7.69.0"
},
{
"fixed": "8.4.0"
}
]
},
{
"repo": "https://github.com/curl/curl.git",
"type": "GIT",
"events": [
{
"introduced": "4a4b63daaa01ef59b131d91e8e6e6dfe275c0f08"
},
{
"fixed": "fb4415d8aee6c1045be932a34fe6107c2f5ed147"
}
]
}
],
"versions": [
"8.3.0",
"8.2.1",
"8.2.0",
"8.1.2",
"8.1.1",
"8.1.0",
"8.0.1",
"8.0.0",
"7.88.1",
"7.88.0",
"7.87.0",
"7.86.0",
"7.85.0",
"7.84.0",
"7.83.1",
"7.83.0",
"7.82.0",
"7.81.0",
"7.80.0",
"7.79.1",
"7.79.0",
"7.78.0",
"7.77.0",
"7.76.1",
"7.76.0",
"7.75.0",
"7.74.0",
"7.73.0",
"7.72.0",
"7.71.1",
"7.71.0",
"7.70.0",
"7.69.1",
"7.69.0",
"curl-8_3_0",
"curl-8_2_1",
"curl-8_2_0",
"curl-8_1_2",
"curl-8_1_1",
"curl-8_1_0",
"curl-8_0_1",
"curl-8_0_0",
"curl-7_88_1",
"curl-7_88_0",
"curl-7_87_0",
"curl-7_86_0",
"curl-7_85_0",
"curl-7_84_0",
"curl-7_83_1",
"curl-7_83_0",
"curl-7_82_0",
"curl-7_81_0",
"curl-7_80_0",
"curl-7_79_1",
"curl-7_79_0",
"curl-7_78_0",
"curl-7_77_0",
"curl-7_76_1",
"curl-7_76_0",
"curl-7_75_0",
"curl-7_74_0",
"curl-7_73_0",
"tiny-curl-7_72_0",
"curl-7_72_0",
"curl-7_71_1",
"curl-7_71_0",
"curl-7_70_0",
"curl-7_69_1",
"curl-7_69_0"
],
"database_specific": {
"source": "https://curl.se/docs/CURL-CVE-2023-38545.json",
"vanir_signatures": [
{
"id": "CURL-CVE-2023-38545-ba35533b",
"digest": {
"threshold": 0.9,
"line_hashes": [
"312460549901445267928349847414673385881",
"275074174645245181067402918537199669107",
"36586585150953595056584450650776892379",
"77800659807126581022969160177335782670",
"168633480660475384767702009198695086351",
"150744559009019551521796744958006889501",
"118894448670136795621524001460295023103",
"235411617067617686159474416391384910533",
"255141486514962514100899321603004904968",
"144159262164073881772169588272567821106"
]
},
"source": "https://github.com/curl/curl.git/commit/fb4415d8aee6c1045be932a34fe6107c2f5ed147",
"target": {
"file": "lib/socks.c"
},
"deprecated": false,
"signature_type": "Line",
"signature_version": "v1"
},
{
"id": "CURL-CVE-2023-38545-da844016",
"digest": {
"length": 10901,
"function_hash": "78686540855549523366077688098291190878"
},
"source": "https://github.com/curl/curl.git/commit/fb4415d8aee6c1045be932a34fe6107c2f5ed147",
"target": {
"file": "lib/socks.c",
"function": "do_SOCKS5"
},
"deprecated": false,
"signature_type": "Function",
"signature_version": "v1"
}
],
"vanir_signatures_modified": "2026-10-25T01:04:40Z"
}
}
],
"modified": "2026-10-25T01:04:40.110399751Z",
"provider": "osv",
"references": [],
"provider_metadata": {
"CWE": {
"id": "CWE-122",
"desc": "Heap-based Buffer Overflow"
},
"URL": "https://curl.se/docs/CVE-2023-38545.json",
"www": "https://curl.se/docs/CVE-2023-38545.html",
"award": {
"amount": "4660",
"currency": "USD"
},
"issue": "https://hackerone.com/reports/2187833",
"affects": "both",
"package": "curl",
"severity": "High",
"last_affected": "8.3.0"
}
},
"related_cves": [
{
"value": "CVE-2023-38545",
"evidence": "/aliases"
}
],
"security_relevant": true,
"severity_evidence": "/database_specific/severity"
},
"source_id": "core-osv",
"document_id": 444274,
"published_at": "2023-10-11T08:00:00+00:00"
}