Когда опция прокси не установлена, HttpClient берет прокси из переменных среды, таких как http_proxy или HTTP_PROXY. На веб-серверах он игнорирует HTTP_PROXY, потому что PHP помещает туда заголовок запроса Proxy (проблема httpoxy). На CLI SAPI он читает HTTP_PROXY от $_SERVER, где PHP также помещает среду.
Сотрудники HTTP, работающие под CLI SAPI, также помещают заголовки каждого запроса в $_SERVER. This is the case of spiral/roadrunner-http, which the RoadRunner runner of php-runtime uses, and of baldinof/roadrunner-bundle and php-pm. Затем клиент может отправить заголовок Proxy для выбора прокси-сервера запросов, отправленных приложением при обработке его запроса.
Этот уполномоченный получил полные запросы на адрес http://URLs с указанием их полномочий и мог подделать ответы. Для https://URLs он выучил хост и порт через CONNECT. NativeHttpClient затрагивается с Symfony 4.3.0, AmpHttpClient с 5.1.0 и CurlHttpClient с 4.4.40, 5.4.7 и 6.0.7. На CLI SAPI, HTTP_PROXY теперь читается из окружающей среды с $_ENV и getenv(), никогда из $_SERVER.
Другие SAPIs по-прежнему игнорируют это.
Показать оригинальное описание (EN)
When the proxy option isn't set, HttpClient takes the proxy from environment variables like http_proxy or HTTP_PROXY. On web servers, it ignores HTTP_PROXY, because PHP puts the Proxy request header there (the httpoxy issue). On the CLI SAPI, it read HTTP_PROXY from $_SERVER, where PHP also puts the environment. HTTP workers that run under the CLI SAPI put the headers of each request in $_SERVER too. This is the case of spiral/roadrunner-http, which the RoadRunner runner of php-runtime uses, and of baldinof/roadrunner-bundle and php-pm. A client could then send a Proxy header to choose the proxy of the requests that the application sent while handling its request. That proxy received the full requests to http:// URLs, with their credentials, and could forge the responses. For https:// URLs, it learned the host and port through CONNECT. NativeHttpClient is affected since Symfony 4.3.0, AmpHttpClient since 5.1.0, and CurlHttpClient since 4.4.40, 5.4.7 and 6.0.7. On the CLI SAPI, HTTP_PROXY is now read from the environment with $_ENV and getenv(), never from $_SERVER. Other SAPIs still ignore it.
Характеристики атаки
Последствия
Строка CVSS v4.0