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 package | Versions | Reported by |
|---|---|---|
| https://github.com/curl/curl | Fixed in 8.0.0 | CVE List |
| https://github.com/curl/curl.git | from 7.18.0 before 8.0.0, from ba6f20a2442ab1ebfe947cff19a552f92114a29a before 4e2b52b5f7a3bf50a0f1494155717b02cc1df6d6 | curl |
| haxx curl | from 7.18.0 up to 7.88.1 | NVD |
| fedoraproject fedora | 36 | NVD |
| netapp active_iq_unified_manager | Not specified | NVD |
| broadcom brocade_fabric_operating_system_firmware | Not specified | NVD |
| netapp h300s_firmware | Not specified | NVD |
| netapp h500s_firmware | Not specified | NVD |
| netapp h700s_firmware | Not specified | NVD |
| netapp h410s_firmware | Not specified | NVD |
| splunk universal_forwarder | from 8.2.0 before 8.2.12, from 9.0.0 before 9.0.6, 9.1.0 | NVD |
All scores
| CISA-ADP | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| curl | low rating | |
| NVD | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Classification
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
| https://hackerone.com/reports/1892351 | exploit, third-party-advisory | |
| https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/36NBD5YLJXXEDZLDGNFCERWRYJQ6LAQW/ | mailing-list, third-party-advisory, vendor-advisory | |
| https://security.netapp.com/advisory/ntap-20230420-0012/ | third-party-advisory | |
| https://security.gentoo.org/glsa/202310-12 | third-party-advisory, vendor-advisory | |
| https://lists.debian.org/debian-lts-announce/2024/03/msg00016.html | mailing-list, third-party-advisory | |
| https://cert-portal.siemens.com/productcert/html/ssa-398330.html | ||
| https://cert-portal.siemens.com/productcert/html/ssa-806742.html | ||
| https://cert-portal.siemens.com/productcert/html/ssa-943925.html | ||
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-27534 changed 2026-10-14 | CVE Terms of Use |
| curl | CURL-CVE-2023-27534 changed 2026-10-25 | MIT |
| NVD | CVE-2023-27534 changed 2026-10-23 | Public domain |