File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments