<div dir="ltr">I fixed this issue in Ubuntu Precise
(<a href="https://bugs.launchpad.net/ubuntu/+source/passenger/+bug/1575220">https://bugs.launchpad.net/ubuntu/+source/passenger/+bug/1575220</a>),
sharing the fix here however this fix was uploaded under the Squeeze LTS
project that concluded in February so I am guessing this may never be uploaded in Debian.<br>
<br>
The current patch modifies the addHeader() function itself to perform
the check, this is invalid because this function is used internally to
setup many headers from the environment such as the standard CGI
HTTP_HOST, REQUEST_URI, etc.<br>
<br>
The correct patch should only abort adding headers from the HTTP request.<br>
<br>
The upstream patch/source for Passenger 5 was quite different to v2
here, however the upstream patch for Passenger 4
(<a href="https://github.com/phusion/passenger/commit/c04590871ca0878d4d3ac1220c5a554b049056b4">https://github.com/phusion/passenger/commit/c04590871ca0878d4d3ac1220c5a554b049056b4</a>)
was very similar and I have backported this fix to precise in the
attached debdiff. I have not backported the nginx part, it was not done
originally.<br><br>
Attaching two versions of my diff against precise, one is against the
current broken version and the other is against the original version which makes it
easier to see what the complete content of the fix now is.<div><br></div><div><div>Patch Testing:</div><div> ** No Patch **</div><div>lathiat@ubuntu:~/src/lp1575220$ curl -s -H "X-Test-Dash-Header: Yes" -H "X_TEST_UNDERSCORE_HEADER: Yes" <a href="http://10.48.134.78/|grep">http://10.48.134.78/|grep</a> -i test</div><div> "HTTP_X_TEST_UNDERSCORE_HEADER"=>"Yes",</div><div> "HTTP_X_TEST_DASH_HEADER"=>"Yes",</div><div><br></div><div> ** Broken Patch **</div><div>lathiat@ubuntu:~/src/lp1575220$ curl -s -H "X-Test-Dash-Header: Yes" -H "X_Test_Underscore_header: Yes" <a href="http://10.48.134.78/|grep">http://10.48.134.78/|grep</a> -i test</div><div><br></div><div> ** New Proposed Patch **</div><div>lathiat@ubuntu:~/src/lp1575220$ curl -s -H "X-Test-Dash-Header: Yes" -H "X_Test_Underscore_header: Yes" <a href="http://10.48.134.78/|grep">http://10.48.134.78/|grep</a> -i test</div><div> "HTTP_X_TEST_DASH_HEADER"=>"Yes",</div><div><br></div><div>Cheers,<br></div>
Trent<br></div></div>