From ${URL} : IMAP FETCH response out of bounds read ====================================== Project curl Security Advisory, October 23rd 2017 - [Permalink](https://curl.haxx.se/docs/adv_20171023.html) VULNERABILITY ------------- libcurl contains a buffer overrun flaw in the IMAP handler. An IMAP FETCH response line indicates the size of the returned data, in number of bytes. When that response says the data is zero bytes, libcurl would pass on that (non-existing) data with a pointer and the size (zero) to the deliver-data function. libcurl's deliver-data function treats zero as a magic number and invokes strlen() on the data to figure out the length. The strlen() is called on a heap based buffer that might not be zero terminated so libcurl might read beyond the end of it into whatever memory lies after (or just crash) and then deliver that to the application as if it was actually downloaded. We are not aware of any exploit of this flaw. INFO ---- This bug was introduced in commit [ec3bb8f727](https://github.com/curl/curl/commit/ec3bb8f727), December 2009, when the initial support for IMAP was introduced. The Common Vulnerabilities and Exposures (CVE) project has assigned the name CVE-2017-1000257 to this issue. AFFECTED VERSIONS ----------------- - Affected versions: libcurl 7.20.0 to and including 7.56.0 - Not affected versions: libcurl < 7.20.0 and >= 7.56.1 curl is used by many applications, but not always advertised as such. THE SOLUTION ------------ In libcurl version 7.56.1, a zero bytes response is not passed on. A [patch for CVE-2017-1000257](https://curl.haxx.se/CVE-2017-1000257.patch) is available. RECOMMENDATIONS --------------- We suggest you take one of the following actions immediately, in order of preference: A - Upgrade curl to version 7.56.1 B - Apply the patch to your version and rebuild C - Switch off IMAP in `CURLOPT_PROTOCOLS` TIME LINE --------- It was reported to the curl project on October 6, 2017. We contacted distros@openwall on October 17. curl 7.56.1 was released on October 23 2017, coordinated with the publication of this advisory. CREDITS ------- Reported by Brian Carpenter, Geeknik Labs and 0xd34db347. Also independently detected by and reported by the OSS-Fuzz project. Patch by Daniel Stenberg. @maintainer(s): after the bump, in case we need to stabilize the package, please let us know if it is ready for the stabilization or not.
*** Bug 635284 has been marked as a duplicate of this bug. ***
(In reply to Agostino Sarubbo from comment #0) > @maintainer(s): after the bump, in case we need to stabilize the package, > please let us know if it is ready for the stabilization or not. I just added it, and tested locally. It should be ready for stabilization. KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 x86"
Can you populate 'Package list' to speedup the process? Thanks!
ia64 stable
amd64 stable
x86 stable
hppa stable
ppc stable
sparc stable (thanks to Rolf Eike Beer)
ppc64 stable
Stable on alpha.
@ Maintainer(s): Stabilization is complete, please clean the vulnerable versions from the tree.
arm stable, all arches done.
Adjusting URL for accurate reference and preserving previous URL to respect reporter. Previous URL: http://www.openwall.com/lists/oss-security/2017/10/23/1 Gentoo Security Padawan (jmbailey/mbailey_j)
New GLSA request filed. Gentoo Security Padawan (jmbailey/mbailey_j)
This issue was resolved and addressed in GLSA 201712-04 at https://security.gentoo.org/glsa/201712-04 by GLSA coordinator Thomas Deutschmann (whissi).