CVE-2017-1000254
libcurl may read outside of a heap allocated buffer when doing FTP. When libcurl connects to an FTP server and successfully logs in (anonymous or not), it asks the server for the current directory with the `PWD` command. The server then responds with a 257 response containing the path, inside double quotes. The returned path name is then kept by libcurl for subsequent uses. Due to a flaw in the string parser for this directory name, a directory name passed like this but without a closing double quote would lead to libcurl not adding a trailing NUL byte to the buffer holding the name. When libcurl would then later access the string, it could read beyond the allocated heap buffer and crash or wrongly access data beyond the buffer, thinking it was part of the path. A malicious server could abuse this fact and effectively prevent libcurl-based clients to work with it - the PWD command is always issued on new FTP connections and the mistake has a high chance of causing a segfault. The simple fact that this has issue remained undiscovered for this long could suggest that malformed PWD responses are rare in benign servers. We are not aware of any exploit of this flaw. This bug was introduced in commit [415d2e7cb7](https://github.com/curl/curl/commit/415d2e7cb7), March 2005. In libcurl version 7.56.0, the parser always zero terminates the string but also rejects it if not terminated properly with a final double quote.
What to do
Fixed builds are available from Alpine, Debian, Ubuntu: see the table below for the fixed version per release.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 16.04 | curl | Fixed | 7.47.0-1ubuntu2.3 | UBUNTU-CVE-2017-1000254 |
| Ubuntu 14.04 | curl | Fixed | 7.35.0-1ubuntu2.11 | UBUNTU-CVE-2017-1000254 |
| Debian 14 | curl | Fixed | 7.56.1-1 | DEBIAN-CVE-2017-1000254 |
| Debian 13 | curl | Fixed | 7.56.1-1 | DEBIAN-CVE-2017-1000254 |
| Debian 12 | curl | Fixed | 7.56.1-1 | DEBIAN-CVE-2017-1000254 |
| Red Hat Enterprise Linux 7 | curl | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 7 | libcurl | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 7 | libcurl-devel | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 6 | curl | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 6 | libcurl | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 6 | libcurl-devel | Will not fix Will not fix | ||
| Red Hat Enterprise Linux 5 | curl | Will not fix Will not fix | ||
| Alpine Linux 3.6 | curl | Fixed | 7.56.0-r0 | ALPINE-CVE-2017-1000254 |
| Alpine Linux 3.5 | curl | Fixed | 7.56.0-r0 | ALPINE-CVE-2017-1000254 |
| Alpine Linux 3.4 | curl | Fixed | 7.55.0-r1 | ALPINE-CVE-2017-1000254 |
| Alpine Linux 3.3 | curl | Fixed | 7.55.0-r1 | ALPINE-CVE-2017-1000254 |
What the vendor says
As published in the CVE record by mitre, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
Vendor advisories:
- https://security.gentoo.org/glsa/201712-04 (vendor-advisory)
- https://access.redhat.com/errata/RHSA-2018:3558 (vendor-advisory)
- https://access.redhat.com/errata/RHSA-2018:2486 (vendor-advisory)
- http://www.debian.org/security/2017/dsa-3992 (vendor-advisory)
References
- https://security.gentoo.org/glsa/201712-04
- https://access.redhat.com/errata/RHSA-2018:3558
- https://support.apple.com/HT208331
- http://www.securitytracker.com/id/1039509
- https://curl.haxx.se/673d0cd8.patch
- https://curl.haxx.se/docs/adv_20171004.html
- https://access.redhat.com/errata/RHSA-2018:2486
- http://www.debian.org/security/2017/dsa-3992
- http://www.securityfocus.com/bid/101115
- https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4%40%3Cissues.bookkeeper.apache.org%3E
- https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b%40%3Cissues.bookkeeper.apache.org%3E
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.