Bug 773457 (CVE-2012-0036)

Summary: CVE-2012-0036 curl: URL sanitization vulnerability
Product: [Other] Security Response Reporter: Vincent Danen <vdanen>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: jlieskov, kdudka, prc, security-response-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-16 00:44:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 784226, 784227, 784228    
Bug Blocks: 773461    
Attachments:
Description Flags
proposed upstream patch
none
proposed upstream patch none

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

Statement:

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:

https://github.com/bagder/curl/commit/75ca568

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

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.