CVE-2023-27534
JSON

8.8high

SFTP path ~ resolving discrepancy

Severity
8.8high CVSS:3.1 by CISA-ADP
Exploit likelihood
2.44% (higher than 84% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
hackerone
Also known as
CURL-CVE-2023-27534

Description

A path traversal vulnerability exists in curl <8.0.0 SFTP implementation causes the tilde (~) character to be wrongly replaced when used as a prefix in the first path element, in addition to its intended use as the first element to indicate a path relative to the user's home directory. Attackers can exploit this flaw to bypass filtering or execute arbitrary code by crafting a path like /~2/foo while accessing a server with a specific user.

Affected

Product or packageVersionsReported by
https://github.com/curl/curlFixed in 8.0.0CVE List
https://github.com/curl/curl.gitfrom 7.18.0 before 8.0.0, from ba6f20a2442ab1ebfe947cff19a552f92114a29a before 4e2b52b5f7a3bf50a0f1494155717b02cc1df6d6curl
haxx curlfrom 7.18.0 up to 7.88.1NVD
fedoraproject fedora36NVD
netapp active_iq_unified_managerNot specifiedNVD
broadcom brocade_fabric_operating_system_firmwareNot specifiedNVD
netapp h300s_firmwareNot specifiedNVD
netapp h500s_firmwareNot specifiedNVD
netapp h700s_firmwareNot specifiedNVD
netapp h410s_firmwareNot specifiedNVD
splunk universal_forwarderfrom 8.2.0 before 8.2.12, from 9.0.0 before 9.0.6, 9.1.0NVD

All scores

CISA-ADP8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
curllow rating
NVD8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-22

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.

What each source says

CVE List

A path traversal vulnerability exists in curl <8.0.0 SFTP implementation causes the tilde (~) character to be wrongly replaced when used as a prefix in the first path element, in addition to its intended use as the first element to indicate a path relative to the user's home directory. Attackers can exploit this flaw to bypass filtering or execute arbitrary code by crafting a path like /~2/foo while accessing a server with a specific user.

curl

curl supports SFTP transfers. curl's SFTP implementation offers a special feature in the path component of URLs: a tilde (~) character as the first path element in the path to denotes a path relative to the user's home directory. This is supported because of wording in the once proposed to-become RFC draft that was to dictate how SFTP URLs work.

Due to a bug, the handling of the tilde in SFTP path did however not only replace it when it is used stand-alone as the first path element but also wrongly when used as a mere prefix in the first element.

Using a path like /~2/foo when accessing a server using the user dan (with home directory /home/dan) would then quite surprisingly access the file /home/dan2/foo.

This can be taken advantage of to circumvent filtering or worse.

NVD (es)

Una vulnerabilidad de salto de ruta existe en la implementación SFTP de curl anterior a 8.0.0 que causa que el carácter tilde (~) sea reemplazado incorrectamente cuando se usa como prefijo en el primer elemento de la ruta, además de su uso previsto como primer elemento para indicar una ruta relativa al directorio de inicio del usuario. Los atacantes pueden explotar esta falla para eludir el filtrado o ejecutar código arbitrario creando una ruta como /~2/foo al acceder a un servidor con un usuario específico.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-27534 changed 2026-10-14CVE Terms of Use
curlCURL-CVE-2023-27534 changed 2026-10-25MIT
NVDCVE-2023-27534 changed 2026-10-23Public domain