{"id":786,"date":"2021-07-23T12:38:10","date_gmt":"2021-07-23T12:38:10","guid":{"rendered":"https:\/\/ssdsunucum.com\/blog\/cve-2016-5387-httpoxy\/"},"modified":"2021-07-23T12:38:10","modified_gmt":"2021-07-23T12:38:10","slug":"cve-2016-5387-httpoxy","status":"publish","type":"post","link":"https:\/\/ssdsunucum.com\/blog\/cve-2016-5387-httpoxy\/","title":{"rendered":"CVE-2016-5387 HTTPOXY"},"content":{"rendered":"<\/p>\n<div class=\"col-md-9\">\n<div class=\"flex-column flex-md-row article-header\"><\/div>\n<hr>\n<h2 id=\"background-information\">Background Information<\/h2>\n<p>On Monday, July 18, 2016, Apache disclosed a vulnerability that affects application code which runs in CGI, or CGI-like environments. This includes the <code>mod_php<\/code> and <code>php-fpm<\/code> Apache modules, among others. For more information on this vulnerability, read the HTTPOXY website.<\/p>\n<h2 id=\"impact\">Impact<\/h2>\n<p>Environments vulnerable to this exploit include any that run PHP or CGI, and use the <code>HTTP_PROXY<\/code> variable to configure outgoing proxies.<\/p>\n<h2 id=\"releases\">Releases<\/h2>\n<p>Apache released a patch for all versions of Apache 2.2 and Apache 2.4.<\/p>\n<p>cPanel &#038; WHM released patched Apache binaries for EasyApache 3 in the 3.34.2 release on July 20, 2016, and for EasyApache 4 in the July 21, 2016, release.<\/p>\n<h2 id=\"how-to-determine-if-your-server-is-up-to-date\">How to determine if your server is up-to-date<\/h2>\n<p>In EasyApache 3, either navigate to the <em>EasyApache<\/em> 3 interface (<em>WHM &gt;&gt; Home &gt;&gt; Software &gt;&gt; EasyApache 3<\/em>) or run the <code>\/usr\/local\/cpanel\/scripts\/easyapache<\/code> script and ensure that your EasyApache 3 version is <code>3.34.2<\/code> or higher.<\/p>\n<p>In EasyApache 4, the updated RPMs provided will contain a changelog entry with a CVE number. To view this changelog entry, run the following command:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">rpm -q --changelog ea-apache24 | grep CVE-2016-5387<\/code><\/pre>\n<\/div>\n<p>The output will resemble the following:\n<\/p>\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">- Apply recommendations in asf-httpoxy-repsponse.txt <span style=\"color:#66d9ef\">for<\/span> CVE-2016-5387<\/code><\/pre>\n<\/div>\n<h2 id=\"what-to-do-if-you-are-not-up-to-date\">What to do if you are not up-to-date<\/h2>\n<p>We released patched Apache binaries for EasyApache 3 on July 20, 2016, and for EasyApache 4 on July 21, 2016. To update your server, perform one of the following steps:<\/p>\n<ul>\n<li>Run an EasyApache 3 build to update your system to version 3.34.2.<\/li>\n<li>In EasyApache 4, run the <code>yum update<\/code> command and ensure that you get an updated package of at least <code>ea-apache24-2.4.23-2<\/code><\/li>\n<\/ul>\n<h3 id=\"manual-mitigation-via-mod-headers\">Manual mitigation via mod_headers<\/h3>\n<h4 id=\"easyapache-3\">EasyApache 3<\/h4>\n<p>To mitigate this issue before cPanel releases the update, you can update the <code>mod_headers<\/code> Apache module to remove the <code>\"Proxy:\"<\/code> header from all incoming requests. Add the following lines to your <code>\/usr\/local\/apache\/conf\/httpd.conf<\/code> file:\n<\/p>\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">3\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">4\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">5\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">6\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">7\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">8\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\">&lt;<span style=\"color:#a6e22e\">IfModule<\/span> <span style=\"color:#a6e22e\">headers_module<\/span>&gt;\n    <span style=\"color:#960050;background-color:#1e0010\">#<\/span>\n    <span style=\"color:#960050;background-color:#1e0010\">#<\/span> <span style=\"color:#a6e22e\">Avoid<\/span> <span style=\"color:#a6e22e\">passing<\/span> <span style=\"color:#a6e22e\">HTTP_PROXY<\/span> <span style=\"color:#a6e22e\">environment<\/span> <span style=\"color:#a6e22e\">to<\/span> <span style=\"color:#a6e22e\">CGI<\/span><span style=\"color:#960050;background-color:#1e0010\">'<\/span><span style=\"color:#a6e22e\">s<\/span> <span style=\"color:#a6e22e\">on<\/span> <span style=\"color:#a6e22e\">this<\/span> <span style=\"color:#a6e22e\">or<\/span> <span style=\"color:#a6e22e\">any<\/span> <span style=\"color:#a6e22e\">proxied<\/span>\n    <span style=\"color:#960050;background-color:#1e0010\">#<\/span> <span style=\"color:#a6e22e\">backend<\/span> <span style=\"color:#a6e22e\">servers<\/span> <span style=\"color:#a6e22e\">which<\/span> <span style=\"color:#a6e22e\">have<\/span> <span style=\"color:#a6e22e\">lingering<\/span> <span style=\"color:#e6db74\">\"httpoxy\"<\/span> <span style=\"color:#a6e22e\">defects<\/span>.\n    <span style=\"color:#960050;background-color:#1e0010\">#<\/span> <span style=\"color:#960050;background-color:#1e0010\">'<\/span><span style=\"color:#a6e22e\">Proxy<\/span><span style=\"color:#960050;background-color:#1e0010\">'<\/span> <span style=\"color:#a6e22e\">request<\/span> <span style=\"color:#a6e22e\">header<\/span> <span style=\"color:#a6e22e\">is<\/span> <span style=\"color:#a6e22e\">undefined<\/span> <span style=\"color:#a6e22e\">by<\/span> <span style=\"color:#a6e22e\">the<\/span> <span style=\"color:#a6e22e\">IETF<\/span>, <span style=\"color:#a6e22e\">not<\/span> <span style=\"color:#a6e22e\">listed<\/span> <span style=\"color:#a6e22e\">by<\/span> <span style=\"color:#a6e22e\">IANA<\/span>\n    <span style=\"color:#960050;background-color:#1e0010\">#<\/span>\n    <span style=\"color:#a6e22e\">RequestHeader<\/span> <span style=\"color:#a6e22e\">unset<\/span> <span style=\"color:#a6e22e\">Proxy<\/span> <span style=\"color:#a6e22e\">early<\/span>\n&lt;<span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">IfModule<\/span>&gt;<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<h4 id=\"easyapache-4\">EasyApache 4<\/h4>\n<p>To mitigate this issue before cPanel releases the update, you can update the <code>mod_headers<\/code> Apache module to remove the <code>\"Proxy:\"<\/code> header from all incoming requests. Add the following lines to your <code>\/etc\/apache2\/conf\/httpd.conf<\/code> file:<\/p>\n<div class=\"highlight\">\n<div style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\">\n<table style=\"border-spacing:0;padding:0;margin:0;border:0;width:auto;overflow:auto;display:block;\">\n<tr>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\"><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">1\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">2\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">3\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">4\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">5\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">6\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">7\n<\/span><span style=\"margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f\">8\n<\/span><\/code><\/pre>\n<\/td>\n<td style=\"vertical-align:top;padding:0;margin:0;border:0;;width:100%\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-go\" data-lang=\"go\">&lt;<span style=\"color:#a6e22e\">IfModule<\/span> <span style=\"color:#a6e22e\">headers_module<\/span>&gt;\n    <span style=\"color:#960050;background-color:#1e0010\">#<\/span>\n    <span style=\"color:#960050;background-color:#1e0010\">#<\/span> <span style=\"color:#a6e22e\">Avoid<\/span> <span style=\"color:#a6e22e\">passing<\/span> <span style=\"color:#a6e22e\">HTTP_PROXY<\/span> <span style=\"color:#a6e22e\">environment<\/span> <span style=\"color:#a6e22e\">to<\/span> <span style=\"color:#a6e22e\">CGI<\/span><span style=\"color:#960050;background-color:#1e0010\">'<\/span><span style=\"color:#a6e22e\">s<\/span> <span style=\"color:#a6e22e\">on<\/span> <span style=\"color:#a6e22e\">this<\/span> <span style=\"color:#a6e22e\">or<\/span> <span style=\"color:#a6e22e\">any<\/span> <span style=\"color:#a6e22e\">proxied<\/span>\n    <span style=\"color:#960050;background-color:#1e0010\">#<\/span> <span style=\"color:#a6e22e\">backend<\/span> <span style=\"color:#a6e22e\">servers<\/span> <span style=\"color:#a6e22e\">which<\/span> <span style=\"color:#a6e22e\">have<\/span> <span style=\"color:#a6e22e\">lingering<\/span> <span style=\"color:#e6db74\">\"httpoxy\"<\/span> <span style=\"color:#a6e22e\">defects<\/span>.\n    <span style=\"color:#960050;background-color:#1e0010\">#<\/span> <span style=\"color:#960050;background-color:#1e0010\">'<\/span><span style=\"color:#a6e22e\">Proxy<\/span><span style=\"color:#960050;background-color:#1e0010\">'<\/span> <span style=\"color:#a6e22e\">request<\/span> <span style=\"color:#a6e22e\">header<\/span> <span style=\"color:#a6e22e\">is<\/span> <span style=\"color:#a6e22e\">undefined<\/span> <span style=\"color:#a6e22e\">by<\/span> <span style=\"color:#a6e22e\">the<\/span> <span style=\"color:#a6e22e\">IETF<\/span>, <span style=\"color:#a6e22e\">not<\/span> <span style=\"color:#a6e22e\">listed<\/span> <span style=\"color:#a6e22e\">by<\/span> <span style=\"color:#a6e22e\">IANA<\/span>\n    <span style=\"color:#960050;background-color:#1e0010\">#<\/span>\n    <span style=\"color:#a6e22e\">RequestHeader<\/span> <span style=\"color:#a6e22e\">unset<\/span> <span style=\"color:#a6e22e\">Proxy<\/span> <span style=\"color:#a6e22e\">early<\/span>\n&lt;<span style=\"color:#f92672\">\/<\/span><span style=\"color:#a6e22e\">IfModule<\/span>&gt;<\/code><\/pre>\n<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<h2 id=\"manual-mitigation-via-modsecurity\">Manual mitigation via ModSecurity<\/h2>\n<p>If you use ModSecurity\u00ae, you can add a custom ModSecurity rule to deny traffic with a Proxy header. To add this rule, perform the following steps:<\/p>\n<ol>\n<li>Navigate to WHM\u2019s <em>ModSecurity\u00ae Configuration<\/em> interface (<em>WHM &gt;&gt; Home &gt;&gt; Security Center &gt;&gt; ModSecurity\u00ae Configuration<\/em>).<\/li>\n<li>Select <em>Process the Rules<\/em> in the <em>Rules Engine<\/em> section.<\/li>\n<li>Click Save.<\/li>\n<li>Navigate to WHM\u2019s <em>Modsecurity\u00ae Tools<\/em> interface (<em>WHM &gt;&gt; Home &gt;&gt; Security Center &gt;&gt; ModSecurity\u00ae Tools<\/em>).<\/li>\n<li>Click <em>Rules List<\/em>. A new interface will appear.<\/li>\n<li>Click <em>Add Rule<\/em>.  A new interface will appear.<\/li>\n<li>Enter the following rule in the <em>Rule Text<\/em> text box:\n<div class=\"highlight\">\n<pre style=\"color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4\"><code class=\"language-BASH\" data-lang=\"BASH\">SecRule &REQUEST_HEADERS:Proxy <span style=\"color:#e6db74\">\"@gt 0\"<\/span> <span style=\"color:#e6db74\">\"id:1000005,log,deny,msg:'httpoxy denied'\"<\/span><\/code><\/pre>\n<\/div>\n<\/li>\n<li>To enable the rule when you deploy the configuration, select the <em>Enable Rule<\/em> checkbox.<\/li>\n<li>To deploy the rule and restart Apache immediately, select the <em>Deploy and Restart Apache<\/em> checkbox.<\/li>\n<li>Click <em>Save<\/em>.\n<div class=\"callout callout-danger\">\n<div class=\"callout-heading\">Warning:<\/div>\n<div class=\"callout-content\">\n<p>This exploit has the potential to affect many different applications. If you experience trouble with other applications after you update your system, you <strong>must<\/strong> contact the application developer for further assistance.<\/p>\n<\/p><\/div>\n<\/div>\n<\/li>\n<\/ol>\n<p>If you still experience issues or need additional help, contact cPanel Support<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Background Information On Monday, July 18, 2016, Apache disclosed a vulnerability that affects application code which runs in CGI, or CGI-like environments. This includes the mod_php and php-fpm Apache modules, among others. For more information on this vulnerability, read the HTTPOXY website. Impact Environments vulnerable to this exploit include any that run PHP or CGI, &hellip;<\/p>\n","protected":false},"author":1,"featured_media":787,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/786"}],"collection":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/comments?post=786"}],"version-history":[{"count":0,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/posts\/786\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media\/787"}],"wp:attachment":[{"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/media?parent=786"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/categories?post=786"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssdsunucum.com\/blog\/wp-json\/wp\/v2\/tags?post=786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}