Bug 1213347 (CVE-2015-3145) - CVE-2015-3145 curl: cookie parser out of boundary memory access
Summary: CVE-2015-3145 curl: cookie parser out of boundary memory access
Status: CLOSED NOTABUG
Alias: CVE-2015-3145
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard: impact=low,public=20150422,reported=2...
Keywords: Security
Depends On: 1214182 1214795 1214796
Blocks: 1213355
TreeView+ depends on / blocked
 
Reported: 2015-04-20 11:03 UTC by Vasyl Kaigorodov
Modified: 2019-06-08 20:33 UTC (History)
20 users (show)

(edit)
It was discovered that libcurl did not properly process cookies with a specially crafted "path" element. If an application using libcurl connected to a malicious HTTP server sending specially crafted "Set-Cookies" headers, this could lead to an out-of-bounds read, and possibly cause that application to crash.
Clone Of:
(edit)
Last Closed: 2015-04-24 11:17:27 UTC


Attachments (Terms of Use)

Description Vasyl Kaigorodov 2015-04-20 11:03:59 UTC
libcurl supports HTTP "cookies" as documented in RFC 6265. Together with each
individual cookie there are several different properties, but for this
vulnerability we focus on the associated "path" element. It tells information
about for which path on a given host the cookies is valid.

The internal libcurl function called `sanitize_cookie_path()` that cleans up
the path element as given to it from a remote site or when read from a file,
did not properly validate the input. If given a path that consisted of a
single double-quote, libcurl would index a newly allocated memory area with
index -1 and assign a zero to it, thus destroying heap memory it wasn't
supposed to.

At best, this gets unnoticed but can also lead to a crash or worse. We have
not researched further what kind of malicious actions that potentially this
could be used for.

Applications have to explicitly enable cookie parsing in libcurl for this
problem to trigger, and if not enabled libcurl will not hit this problem.

We are not aware of any exploits of this flaw.

Affected versions: from libcurl 7.31.0 to and including 7.41.0

Acknowledgements:

Red Hat would like to thank Daniel Stenberg (curl upstream) for reporting this issue. Upstream acknowledges Hanno Böck as the original reporter.

Comment 1 Martin Prpič 2015-04-22 07:55:08 UTC
External References:

http://curl.haxx.se/docs/adv_20150422C.html

Comment 2 Martin Prpič 2015-04-22 07:56:52 UTC
Created curl tracking bugs for this issue:

Affects: fedora-all [bug 1214182]

Comment 4 Stefan Cornelius 2015-04-23 14:32:21 UTC
Created mingw-curl tracking bugs for this issue:

Affects: fedora-all [bug 1214795]
Affects: epel-7 [bug 1214796]

Comment 5 Stefan Cornelius 2015-04-23 14:38:52 UTC
Patch:
http://curl.haxx.se/CVE-2015-3145.patch

Comment 6 Huzaifa S. Sidhpurwala 2015-04-24 08:41:24 UTC
Statement:

Not vulnerable. This issue does not affect the version of curl as shipped with Red Hat Enterprise Linux 5, 6 and 7.

Comment 8 Fedora Update System 2015-04-26 12:42:45 UTC
curl-7.40.0-3.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2015-04-28 13:01:25 UTC
curl-7.32.0-20.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2015-05-02 18:11:34 UTC
curl-7.37.0-14.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.