Bug 1290405 (CVE-2015-7519)

Summary: CVE-2015-7519 passenger: Header overwriting issue allowing user impersonation
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: abaron, abhgupta, aortega, apevec, ayoung, bbuckingham, bcourt, bkearney, brett.lentz, btotty, ccoleman, chrisw, cpelland, dallan, dmcphers, gkotton, gmollett, hhorak, hhudgeon, jialiu, jkaluza, joelsmith, jokerman, jorton, jschluet, katello-bugs, kseifried, lhh, lmeyer, lpeer, luhliari, lzap, markmc, mburns, mmaslano, mmccomas, mmccune, nmoumoul, ohadlevy, rbryant, rchan, rhos-maint, rjerrido, sclewis, sisharma, sokeeffe, srevivo, tdawson, tdecacqu, tiwillia, tjay, tlestach, vanmeeuwen+fedora
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: passenger 4.0.60, passenger 5.0.22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-30 12:00:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1290406, 1290407, 1290408    
Bug Blocks: 1292105    

Description Adam Mariš 2015-12-10 13:02:30 UTC
It was found that when SCGI protocol is used and an app depends on a header set by trusted server that includes a dash, it is possible for a untrusted remote client to set colliding header, which would appear different to the server and won't be overwriteen but preserved, e.g.

Foobar-User: user
Foobar_User: impersonation

Conversion of the headers for SCGI requires dropping the difference (in this case _ and -), which results in Passenger sending two headers with the same key:

HTTP_FOOBAR_USER: user
HTTP_FOOBAR_USER: impersonation

The value of the second HTTP_FOOBAR_USER may overwrite the value of the first if hashmap is used, making the application believe a different value was set by the server. If header is used fo authentication, unauthenticated remote attacker can impersonate local user.

Upstream patch:

https://github.com/phusion/passenger/commit/ddb8ecc4ebf260e4967f57f271d4f5761abeac3e

Public via:

http://seclists.org/oss-sec/2015/q4/443

Comment 3 Adam Mariš 2015-12-10 13:03:51 UTC
Created passenger tracking bugs for this issue:

Affects: fedora-all [bug 1290408]

Comment 4 Tomas Hoger 2016-01-25 10:40:06 UTC
Original SUSE bug report:

https://bugzilla.suse.com/show_bug.cgi?id=956281

Issue was fixed upstream in both 5.0.22 and 4.0.60:

https://blog.phusion.nl/2015/12/07/passenger-5-0-22/
https://blog.phusion.nl/2015/12/07/passenger-4-0-60/

Upstream blog post with further details and workaround for setups using httpd.

External References:

https://blog.phusion.nl/2015/12/07/cve-2015-7519/