Bug 1326242 (CVE-2016-3112)

Summary: CVE-2016-3112 pulp: Agent certificate containing private key is stored in world-readable file
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: bkearney, cbillett, jcline, jmatthew, mmccune, ohadlevy, rbarlow, sean.myers, security-response-team, tjay, tlestach, tsanders
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
It was found that the private key for the agent certificate was contained in a world-readable file. A local user could possibly use this flaw to gain access to the private key information in the file.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-19 19:02:56 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: 1326913, 1326919    
Bug Blocks: 1325942    
Attachments:
Description Flags
Proposed patch
none
python2.4-compatible patch none

Description Adam Mariš 2016-04-12 08:53:59 UTC
It was reported that certificate that identifies agent is written to etc/pki/pulp/consumer/consumer-cert.pem with 644 permissions and contains also the private key, making it world-readable.

Comment 1 Adam Mariš 2016-04-12 08:54:08 UTC
Acknowledgments:

Name: Jeremy Cline (Red Hat)

Comment 3 Jeremy Cline 2016-04-12 15:50:09 UTC
Created attachment 1146527 [details]
Proposed patch

This fixes the issue where new certificates and keys are written with 644 permissions, but it doesn't do anything for all the keys and certificates that already exist.

Comment 4 Randy Barlow 2016-04-12 16:00:09 UTC
From a security perspective, the current proposed patch seems OK, but I believe this code needs to be able to work in Python 2.4 (RHEL 5) which does not have the with statement available.

Comment 5 Jeremy Cline 2016-04-12 16:29:43 UTC
Created attachment 1146538 [details]
python2.4-compatible patch

This patch works with Python 2.4 which is a requirement, as Randy noted. Thanks, Randy!

Comment 6 Randy Barlow 2016-04-13 14:19:48 UTC
This patch looks good to me, thanks jcline!

Comment 9 Kurt Seifried 2016-09-19 19:02:56 UTC
This issue has been addressed in the following products:

  Red Hat Satellite 6.2

Via RHSA-2016:1501