Skip to content

Commit 18f044f

Browse files
committed
we don't use the HTTP_PROXY environment variable in uppercase anymore, since
it might become a security problem (Bugs item #415391)
1 parent d7b54eb commit 18f044f

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

lib/url.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1579,7 +1579,19 @@ static CURLcode Connect(struct UrlData *data,
15791579
/* read the protocol proxy: */
15801580
prox=curl_getenv(proxy_env);
15811581

1582-
if(!prox) {
1582+
/*
1583+
* We don't try the uppercase version of HTTP_PROXY because of
1584+
* security reasons:
1585+
*
1586+
* When curl is used in a webserver application
1587+
* environment (cgi or php), this environment variable can
1588+
* be controlled by the web server user by setting the
1589+
* http header 'Proxy:' to some value.
1590+
*
1591+
* This can cause 'internal' http/ftp requests to be
1592+
* arbitrarily redirected by any external attacker.
1593+
*/
1594+
if(!prox && !strequal("http_proxy", proxy_env)) {
15831595
/* There was no lowercase variable, try the uppercase version: */
15841596
for(envp = proxy_env; *envp; envp++)
15851597
*envp = toupper(*envp);

0 commit comments

Comments
 (0)