CVE-2012-0036: SQL Injection
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.
Other sources
curl and libcurl 7.2x before 7.24.0 do not properly consider special characters during extraction of a pathname from a URL, which allows remote attackers to conduct data-injection attacks via a crafted URL, as demonstrated by a CRLF injection attack on the (1) IMAP, (2) POP3, or (3) SMTP protocol.
Affected Software
Remediation
Patch Available
Event History
Frequently Asked Questions
What is the severity of CVE-2012-0036?
CVE-2012-0036 is classified as a medium severity vulnerability due to potential data injection attacks.
How do I fix CVE-2012-0036?
To fix CVE-2012-0036, update libcurl to version 7.23.2 or later.
What software is affected by CVE-2012-0036?
CVE-2012-0036 affects multiple versions of curl and libcurl, specifically versions from 7.20.0 to 7.23.1.
What type of vulnerability is CVE-2012-0036?
CVE-2012-0036 is a data injection vulnerability that occurs due to improper URL sanitization in libcurl.
Can CVE-2012-0036 be exploited remotely?
Yes, CVE-2012-0036 can potentially be exploited remotely via maliciously crafted URLs.