How to fix Httpoxy a CGI PHP/Nginx/Apache/Go application vulnerability on Linux or Unix

htt‮‬ps://www.lautturi.com
How to fix Httpoxy a CGI PHP/Nginx/Apache/Go application vulnerability on Linux or Unix

Httpoxy is a security vulnerability that affects web applications that run on servers using CGI (Common Gateway Interface) to process HTTP requests. The vulnerability allows an attacker to manipulate the HTTP_PROXY environment variable, which can be used to proxy HTTP requests through a malicious server. This can lead to various attacks, such as cross-site scripting (XSS) or man-in-the-middle attacks.

To fix the Httpoxy vulnerability in a CGI-based web application on Linux or Unix, you will need to take the following steps:

  1. Patch the vulnerable software:

  2. If you are using a web server or application that is vulnerable to Httpoxy, you should update to the latest version to receive a patch for the vulnerability. This will typically involve upgrading the web server or application software, or applying a security patch.

  3. Configure the web server to block or ignore the HTTP_PROXY environment variable:

  4. If it is not possible to patch the vulnerable software, you can configure the web server to block or ignore the HTTP_PROXY environment variable. This will prevent the vulnerability from being exploited, even if the software is still vulnerable.

  5. In Nginx, you can use the fastcgi_param directive to specify which environment variables should be passed to the CGI script. To block the HTTP_PROXY variable, you can add the following line to the fastcgi_param block in the Nginx configuration file:

fastcgi_param HTTP_PROXY "";
  1. In Apache, you can use the SetEnvIf directive to specify which environment variables should be passed to the CGI script. To block the HTTP_PROXY variable, you can add the following line to the Apache configuration file:
SetEnvIf HTTP_PROXY "(.*)" block_http_proxy=1
RequestHeader unset HTTP_PROXY env=block_http_proxy
Created Time:2017-10-28 21:39:03  Author:lautturi