CVE-2009-0037
The redirect implementation in curl and libcurl 5.11 through 7.19.3, when CURLOPT_FOLLOWLOCATION is enabled, accepts arbitrary Location values, which might allow remote HTTP servers to (1) trigger arbitrary requests to intranet servers, (2) read or overwrite arbitrary files via a redirect to a file: URL, or (3) execute arbitrary commands via a redirect to an scp: URL.
02 / AFFECTED SOFTWARE
Affected packages
168 explicit affected versions
03 / CONNECTIONS
Connected vulnerabilities
04 / EVIDENCE
Source records
When told to follow a "redirect" automatically, libcurl does not question the new target URL but follows it to any new URL that it understands. As libcurl supports FILE:// URLs, a rogue server can thus "trick" a libcurl-using application to read a local file instead of the remote one. This is a problem, for example, when the application is running on a server and is written to upload or to otherwise provide the transferred data to a user, to another server or to another application etc, as it can be used to expose local files it was not meant to. The problem can also be exploited for uploading, if the rogue server redirects the client to a local file and thus it would (over)write a local file instead of sending it to the server. libcurl compiled to support SCP can get tricked to get a file using embedded semicolons, which can lead to execution of commands on the given server. `Location: scp://name:passwd@host/a;date >/tmp/test;`. Files on servers other than the one running libcurl are also accessible when credentials for those servers are stored in the .netrc file of the user running libcurl. This is most common for FTP servers, but can occur with any protocol supported by libcurl. Files on remote SSH servers are also accessible when the user has an unencrypted SSH key.
The redirect implementation in curl and libcurl 5.11 through 7.19.3, when CURLOPT_FOLLOWLOCATION is enabled, accepts arbitrary Location values, which might allow remote HTTP servers to (1) trigger arbitrary requests to intranet servers, (2) read or overwrite arbitrary files via a redirect to a file: URL, or (3) execute arbitrary commands via a redirect to an scp: URL.
05 / REFERENCES
Further evidence
- http://curl.haxx.se/docs/adv_20090303.html
- http://curl.haxx.se/lxr/source/CHANGES
- http://lists.apple.com/archives/security-announce/2010//Mar/msg00001.html
- http://lists.opensuse.org/opensuse-security-announce/2009-03/msg00001.html
- http://lists.vmware.com/pipermail/security-announce/2009/000060.html
- http://secunia.com/advisories/34138
- http://secunia.com/advisories/34202
- http://secunia.com/advisories/34237
- http://secunia.com/advisories/34251
- http://secunia.com/advisories/34255
- http://secunia.com/advisories/34259
- http://secunia.com/advisories/34399
- http://secunia.com/advisories/35766
- http://security.gentoo.org/glsa/glsa-200903-21.xml
- http://slackware.com/security/viewer.php?l=slackware-security&y=2009&m=slackware-security.476602
- http://support.apple.com/kb/HT4077
- http://wiki.rpath.com/wiki/Advisories:rPSA-2009-0042
- http://www.debian.org/security/2009/dsa-1738
- http://www.redhat.com/support/errata/RHSA-2009-0341.html
- http://www.securityfocus.com/archive/1/501757/100/0/threaded
- http://www.securityfocus.com/archive/1/504849/100/0/threaded
- http://www.securityfocus.com/bid/33962
- http://www.securitytracker.com/id?1021783
- http://www.ubuntu.com/usn/USN-726-1
- http://www.vmware.com/security/advisories/VMSA-2009-0009.html
- http://www.vupen.com/english/advisories/2009/0581
- http://www.vupen.com/english/advisories/2009/1865
- http://www.withdk.com/2009/03/03/curllibcurl-redirect-arbitrary-file-access/
- http://www.withdk.com/archives/Libcurl_arbitrary_file_access.pdf
- https://exchange.xforce.ibmcloud.com/vulnerabilities/49030
- https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A11054
- https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A6074