Red Hat Bugzilla – Bug 773457
CVE-2012-0036 curl: URL sanitization vulnerability
Last modified: 2014-01-15 19:44:35 EST
A flaw was found in the way that curl sanitized URLs. The upstream advisory  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
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.
Not vulnerable. This issue did not affect the versions of curl as shipped with Red Hat Enterprise Linux 4, 5 or 6.
Created attachment 552243 [details]
proposed upstream patch
Created attachment 556625 [details]
proposed upstream patch
Updated version of upstream's patch.
Upstream security page describing this issue:
Particular CVE-2012-0036 dedicated advisory from upstream:
Final version of upstream patch:
Created mingw32-curl tracking bugs for this issue
Affects: fedora-all [bug 784227]
Affects: epel-5 [bug 784228]
Created curl tracking bugs for this issue
Affects: fedora-all [bug 784226]
Red Hat would like to thank the cURL project for reporting this issue.
Upstream acknowledges Dan Fandrich as the original reporter.
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.
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.