<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CRIN Trac: Ticket #78: HTTP_PROXY possible security risk</title>
    <link>https://trac.crin.org/trac/ticket/78</link>
    <description>&lt;p&gt;
See &lt;a class="ext-link" href="https://httpoxy.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;httpoxy&lt;/a&gt;.
&lt;/p&gt;
</description>
    <language>en-us</language>
    <image>
      <title>CRIN Trac</title>
      <url>https://trac.crin.org/trac/chrome/site/logo.gif</url>
      <link>https://trac.crin.org/trac/ticket/78</link>
    </image>
    <generator>Trac 1.0.2</generator>
    <item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 19 Jul 2016 10:53:32 GMT</pubDate>
      <title>hours changed; totalhours set</title>
      <link>https://trac.crin.org/trac/ticket/78#comment:1</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/78#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.5&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                set to &lt;em&gt;0.5&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
For Apache we need to unset any incoming &lt;tt&gt;PROXY&lt;/tt&gt; headers:
&lt;/p&gt;
&lt;pre class="wiki"&gt;RequestHeader unset Proxy early
&lt;/pre&gt;&lt;p&gt;
For the Nginx reverse proxy to php5-fpm this needs adding to remove the &lt;tt&gt;PROXY&lt;/tt&gt; header from incoming HTTP requests:
&lt;/p&gt;
&lt;pre class="wiki"&gt;fastcgi_param HTTP_PROXY "";
&lt;/pre&gt;&lt;p&gt;
So on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt;, which is running Apache, the following was added to all the &lt;tt&gt;VirtualHost&lt;/tt&gt;s:
&lt;/p&gt;
&lt;pre class="wiki"&gt;        &amp;lt;IfModule headers_module&amp;gt;
                # https://httpoxy.org/
                RequestHeader unset Proxy early
        &amp;lt;/IfModule&amp;gt;
&lt;/pre&gt;&lt;p&gt;
On &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt; every section of Nginx configuration which passes requests to &lt;tt&gt;php5-fpm&lt;/tt&gt; and or Tomcat had the following added:
&lt;/p&gt;
&lt;pre class="wiki"&gt;fastcgi_param HTTP_PROXY "";
&lt;/pre&gt;&lt;p&gt;
On &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt; the same was done as for &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin2"&gt;Crin2&lt;/a&gt; but also this was added for the dev site proxy to the live site for media files:
&lt;/p&gt;
&lt;pre class="wiki"&gt;proxy_set_header Proxy "";
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 19 Jul 2016 10:55:23 GMT</pubDate>
      <title>status changed; resolution set</title>
      <link>https://trac.crin.org/trac/ticket/78#comment:2</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/78#comment:2</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Tue, 19 Jul 2016 12:25:30 GMT</pubDate>
      <title>hours, totalhours changed</title>
      <link>https://trac.crin.org/trac/ticket/78#comment:3</link>
      <guid isPermaLink="false">https://trac.crin.org/trac/ticket/78#comment:3</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0&lt;/em&gt; to &lt;em&gt;0.25&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.5&lt;/em&gt; to &lt;em&gt;0.75&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Testing this on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin1"&gt;Crin1&lt;/a&gt;, creating a &lt;a class="ext-link" href="https://wiki.crin.org/w/asdfagagda.php"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://wiki.crin.org/w/asdfagagda.php&lt;/a&gt; test file containing:
&lt;/p&gt;
&lt;pre class="wiki"&gt;&amp;lt;?php
// Show all information, defaults to INFO_ALL
phpinfo();
// Show just the module information.
// phpinfo(8) yields identical results.
//phpinfo(INFO_MODULES);
?&amp;gt;
&lt;/pre&gt;&lt;p&gt;
And using the Firefox &lt;a class="ext-link" href="http://www.garethhunt.com/modifyheaders/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;Modify Headers&lt;/a&gt; and &lt;a class="ext-link" href="http://livehttpheaders.mozdev.org/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;livehttpheaders&lt;/a&gt; add ons to test:
&lt;/p&gt;
&lt;pre class="wiki"&gt;https://wiki.crin.org/w/asdfagagda.php
GET /w/asdfagagda.php HTTP/1.1
Host: wiki.crin.org
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate, br
DNT: 1
Proxy: http://foo.bar/
Connection: keep-alive
HTTP/1.1 200 OK
Date: Tue, 19 Jul 2016 12:15:34 GMT
Server: Apache/2.4.10 (Debian)
Strict-Transport-Security: max-age=31536000
X-Frame-Options: sameorigin
Vary: Host,Accept-Encoding
Content-Encoding: gzip
Content-Length: 27158
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
----------------------------------------------------------
&lt;/pre&gt;&lt;p&gt;
And the &lt;tt&gt;HTTP_PROXY&lt;/tt&gt; env var isn't set, so that worked, deleting the &lt;tt&gt;asdfagagda.php&lt;/tt&gt; file.
&lt;/p&gt;
&lt;p&gt;
Testing on &lt;a class="wiki" href="https://trac.crin.org/trac/wiki/Crin4"&gt;Crin4&lt;/a&gt; (on the basis that if it is fixed here it'll be fixed on the live server), created &lt;tt&gt;/var/www/dev/docroot/asgaadgagad.php&lt;/tt&gt; and testing it via &lt;a class="ext-link" href="https://dev.crin.org/asgaadgagad.php"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://dev.crin.org/asgaadgagad.php&lt;/a&gt; and the &lt;tt&gt;HTTP_PROXY&lt;/tt&gt; env var isn't set, so the fix works:
&lt;/p&gt;
&lt;pre class="wiki"&gt;https://dev.crin.org/asgaadgagad.php
GET /asgaadgagad.php HTTP/1.1
Host: dev.crin.org
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate, br
DNT: 1
Proxy: http://foo.bar/
Connection: keep-alive
HTTP/1.1 200 OK
Server: nginx/1.6.2
Date: Tue, 19 Jul 2016 12:22:28 GMT
Content-Type: text/html; charset=UTF-8
php-cache: HIT
Content-Encoding: gzip
X-Firefox-Spdy: 3.1
----------------------------------------------------------
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>