Bug 773457 (CVE-2012-0036) - CVE-2012-0036 curl: URL sanitization vulnerability
Summary: CVE-2012-0036 curl: URL sanitization vulnerability
Alias: CVE-2012-0036
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 784226 784227 784228
Blocks: 773461
TreeView+ depends on / blocked
Reported: 2012-01-11 21:22 UTC by Vincent Danen
Modified: 2023-05-12 22:40 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-01-16 00:44:35 UTC

Attachments (Terms of Use)
proposed upstream patch (7.68 KB, patch)
2012-01-11 21:28 UTC, Vincent Danen
no flags Details | Diff
proposed upstream patch (7.76 KB, patch)
2012-01-20 23:19 UTC, Vincent Danen
no flags Details | Diff

Description Vincent Danen 2012-01-11 21:22:38 UTC
A flaw was found in the way that curl sanitized URLs.  The upstream advisory [1] reports:

   libcurl is vulnerable to a data injection attack for certain protocols
   through control characters embedded or percent-encoded in URLs.

   When parsing URLs, libcurl's parser is very laxed and liberal and only
   parses as little as possible and lets as much as possible through as long as
   it can figure out what to do.

   In the specific process when libcurl extracts the file path part from a
   given URL, it didn't always verify the data or escape control characters
   properly before it passed the file path on to the protocol-specific code
   that then would use it for its protocol business.

   This passing through of control characters could be exploited by someone who
   would be able to pass in a handicrafted URL to libcurl. Lots of libcurl
   using applications let users enter URLs in one form or another and not all
   of these check the input carefully to prevent malicious ones.

   A malicious user might pass in %0d%0a to get treated as CR LF by libcurl,
   and by using this fact a user can trick for example a POP3 client to delete
   a message instead of getting it or trick an SMTP server to send an
   unintended message.

   This vulnerability can be used to fool libcurl with the following protocols:
   IMAP, POP3 and SMTP.
                                                                                                                                                                                    There is no known exploit for this problem.

This flaw only affects curl versions 7.20.0 up to and including 7.23.1  It is corrected in 7.24.0 by scanning for a range of "bad codes" in the path part of URLs so that they are rejected before any protocol code even can consider using them.

This flaw has been assigned the name CVE-2012-0036.

[1] http://curl.haxx.se/docs/security.html


Not vulnerable. This issue did not affect the versions of curl as shipped with Red Hat Enterprise Linux 4, 5 or 6.

Comment 1 Vincent Danen 2012-01-11 21:28:07 UTC
Created attachment 552243 [details]
proposed upstream patch

Comment 3 Vincent Danen 2012-01-20 23:19:02 UTC
Created attachment 556625 [details]
proposed upstream patch

Updated version of upstream's patch.

Comment 4 Jan Lieskovsky 2012-01-24 09:37:38 UTC
Upstream security page describing this issue:
[2] http://curl.haxx.se/docs/security.html

Particular CVE-2012-0036 dedicated advisory from upstream:
[3] http://curl.haxx.se/docs/adv_20120124.html

Final version of upstream patch:
[4] http://curl.haxx.se/curl-url-sanitize.patch

Comment 5 Jan Lieskovsky 2012-01-24 10:56:05 UTC
Created mingw32-curl tracking bugs for this issue

Affects: fedora-all [bug 784227]
Affects: epel-5 [bug 784228]

Comment 6 Jan Lieskovsky 2012-01-24 10:56:09 UTC
Created curl tracking bugs for this issue

Affects: fedora-all [bug 784226]

Comment 7 Kamil Dudka 2012-01-24 12:03:00 UTC
upstream commit:


Comment 8 Jan Lieskovsky 2012-01-25 09:13:13 UTC

Red Hat would like to thank the cURL project for reporting this issue.
Upstream acknowledges Dan Fandrich as the original reporter.

Comment 9 Fedora Update System 2012-01-28 03:31:01 UTC
curl-7.21.7-6.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2012-02-11 22:04:51 UTC
curl-7.21.3-13.fc15 has been pushed to the Fedora 15 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.