Bug 1058992 (CVE-2014-1831, CVE-2014-1832)

Summary: CVE-2014-1831 CVE-2014-1832 rubygem-passenger: insecure use of temporary files
Product: [Other] Security Response Reporter: Vincent Danen <vdanen>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: aortega, apevec, athomas, ayoung, brett.lentz, chrisw, cwolfe, drieden, gkotton, gmollett, hhorak, iheim, jkaluza, jorton, jrusnack, lhh, luhliari, markmc, mmaslano, mmcgrath, nobody+bgollahe, rbryant, rhos-maint, sclewis, tdawson, vanmeeuwen+fedora, vondruch, yeylon
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rubygem-passenger 4.0.38 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-26 00:13:49 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: 1058993, 1059084    
Bug Blocks: 1058994    

Description Vincent Danen 2014-01-28 23:18:57 UTC
An upstream commit [1] to the Passenger rubygem indicated that versions 4.0.5 and later are affected by a temporary file flaw described as follows:

"
Phusion Passenger creates a "server instance directory" in /tmp during startup,
which is a temporary directory that Phusion Passenger uses to store working files.
This directory is deleted after Phusion Passenger exits. For various technical
reasons, this directory must have a semi-predictable filename. If a local attacker
can predict this filename, and precreates a symlink with the same filename that
points to an arbitrary directory with mode 755, owner root and group root, then
the attacker will succeed in making Phusion Passenger write files and create
subdirectories inside that target directory. The following files/subdirectories
are created:

* control_process.pid
* generation-X, where X is a number.

If you happen to have a file inside the target directory called `control_process.pid`, then that file's contents are overwritten.

These files and directories are deleted during Phusion Passenger exit. The target
directory itself is not deleted, nor are any other contents inside the target
directory, although the symlink is.
"

It is fixed in upstream version 4.0.33.

[1] https://github.com/phusion/passenger/commit/34b1087870c2

Comment 1 Vincent Danen 2014-01-28 23:20:37 UTC
Created rubygem-passenger tracking bugs for this issue:

Affects: fedora-20 [bug 1058993]

Comment 3 Vincent Danen 2014-01-31 15:14:41 UTC
This fix is also required:

https://github.com/phusion/passenger/commit/94428057c602da3d6d34ef75c78091066ecac5c0

MITRE has assigned two CVEs here:

Use CVE-2014-1831 for the vulnerability with the "before 4.0.33"
affected versions.

Use CVE-2014-1832 for the vulnerability with the "4.0.33 and earlier"
affected versions.


CVE-2014-1831 would correspond to the original commit.  This second commit would correspond to CVE-2014-1832 because "there's a race condition between the stat check introduced in 34b1087870c2" [1].

So both CVEs are applicable here, so noting them both.

[1] http://openwall.com/lists/oss-security/2014/01/30/3

Comment 4 Tomas Hoger 2014-02-03 14:03:00 UTC
(In reply to Vincent Danen from comment #0)
> It is fixed in upstream version 4.0.33.
> 
> [1] https://github.com/phusion/passenger/commit/34b1087870c2

This should say 4.0.37, and hence:

(In reply to Vincent Danen from comment #3)
> Use CVE-2014-1831 for the vulnerability with the "before 4.0.33"
> affected versions.
> 
> Use CVE-2014-1832 for the vulnerability with the "4.0.33 and earlier"
> affected versions.

should say "before 4.0.37" and "4.0.37 and earlier".