CVEfocus › CVE database › CVE-2017-1000254

CVE-2017-1000254

CVSS 7.5 HighEPSS 8.1% (higher than 95% of CVEs)Published 2017-10-06Updated 2024-08-05Assigner: mitre

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

9Fixed
7Will not fix

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 16.04curlFixed7.47.0-1ubuntu2.3UBUNTU-CVE-2017-1000254
Ubuntu 14.04curlFixed7.35.0-1ubuntu2.11UBUNTU-CVE-2017-1000254
Debian 14curlFixed7.56.1-1DEBIAN-CVE-2017-1000254
Debian 13curlFixed7.56.1-1DEBIAN-CVE-2017-1000254
Debian 12curlFixed7.56.1-1DEBIAN-CVE-2017-1000254
Red Hat Enterprise Linux 7curlWill not fix
Will not fix
Red Hat Enterprise Linux 7libcurlWill not fix
Will not fix
Red Hat Enterprise Linux 7libcurl-develWill not fix
Will not fix
Red Hat Enterprise Linux 6curlWill not fix
Will not fix
Red Hat Enterprise Linux 6libcurlWill not fix
Will not fix
Red Hat Enterprise Linux 6libcurl-develWill not fix
Will not fix
Red Hat Enterprise Linux 5curlWill not fix
Will not fix
Alpine Linux 3.6curlFixed7.56.0-r0ALPINE-CVE-2017-1000254
Alpine Linux 3.5curlFixed7.56.0-r0ALPINE-CVE-2017-1000254
Alpine Linux 3.4curlFixed7.55.0-r1ALPINE-CVE-2017-1000254
Alpine Linux 3.3curlFixed7.55.0-r1ALPINE-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:

References

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.