Bug 1592612 (CVE-2018-12029)

Summary: CVE-2018-12029 passenger: CHMOD race condition in nginx_module/ngx_http_passenger_module.c allows for local privilege escalation
Product: [Other] Security Response Reporter: Sam Fowler <sfowler>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: abhgupta, barracks510, bcourt, bkearney, bperkins, dbaker, jkaluza, jokerman, mmccune, mrike, ohadlevy, rchan, rjerrido, sisharma, sthangav, tdawson, trankin, vanmeeuwen+fedora
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: passenger 5.3.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-10 10:29:29 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: 1592613, 1592614    
Bug Blocks: 1592615    

Description Sam Fowler 2018-06-19 00:39:33 UTC
Phusion Passenger versions 3.0.0 through 5.3.1 are vulnerable to a file system access race condition in the Nginx module that allows for local privilege escalation. The vulnerability was exploitable only when running a non-standard passenger_instance_registry_dir, via a race condition where after a file was created, there was a window in which it could be replaced with a symlink before it was chowned via the path and not the file descriptor.

If the symlink target was to a file which would be executed by root such as root's crontab file, then privilege escalation was possible.


External References:

https://blog.phusion.nl/2018/06/12/passenger-5-3-2-various-security-fixes/
https://pulsesecurity.co.nz/advisories/phusion-passenger-priv-esc


Upstream Patch:

https://github.com/phusion/passenger/commit/207870f5b7f5cc240587ab0977d6046782ae1d86

Comment 1 Sam Fowler 2018-06-19 00:39:54 UTC
Created passenger tracking bugs for this issue:

Affects: epel-7 [bug 1592614]
Affects: fedora-all [bug 1592613]

Comment 2 Siddharth Sharma 2018-06-19 15:18:11 UTC
Red Hat Ceph Storage 1.3 shipped rubygem-passenger as dependency to support rhcs-installer which was shipped as Tech Preview only.