Bug 906207 (CVE-2012-6116) - CVE-2012-6116 Candlepin: bootstrap RPM deploys CA certificate file with mode 666
Summary: CVE-2012-6116 Candlepin: bootstrap RPM deploys CA certificate file with mode 666
Keywords:
Status: CLOSED WONTFIX
Alias: CVE-2012-6116
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
: 876580 (view as bug list)
Depends On: 877387 896255 906208 924247 995675 995676
Blocks: 906209 906638 917158
TreeView+ depends on / blocked
 
Reported: 2013-01-31 06:27 UTC by Kurt Seifried
Modified: 2023-05-12 17:24 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-21 21:05:48 UTC
Embargoed:


Attachments (Terms of Use)
Fix for the permissions issue (in installer) (1.67 KB, patch)
2013-02-22 14:38 UTC, Martin Bacovsky
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0547 0 normal SHIPPED_LIVE Moderate: CloudForms System Engine 1.1.2 update 2013-02-22 00:01:10 UTC
Red Hat Product Errata RHSA-2013:0686 0 normal SHIPPED_LIVE Moderate: Subscription Asset Manager 1.2.1 update 2013-03-26 23:16:44 UTC

Description Kurt Seifried 2013-01-31 06:27:17 UTC
Dominic Cleal reports 

Description of problem:
katello-configure generates a bootstrap RPM for installation on clients to be 
connected to the Katello server.  This contains a CA certificate for Candlepin
which has a mode set of 0666, permitting other users on a client system to 
modify the CA used to trust the remote Katello server.

The RPM is named after the FQDN of the Katello server, e.g.
candlepin-cert-consumer-$FQDN

# ll /etc/rhsm/ca/candlepin-local.pem 
-rw-rw-rw-. 1 root root 5385 Nov 12 16:21 /etc/rhsm/ca/candlepin-local.pem

# rpm -qalv candlepin-cert-consumer-\*
-rw-rw-rw-    1 root    root  5385 Nov 12 16:21 /etc/rhsm/ca/candlepin-local.pem

Version-Release number of selected component (if applicable):
Tested on 1.1 release, verified code present in git master.

How reproducible:
Always.

Steps to Reproduce:
1. install Katello (https://fedorahosted.org/katello/wiki/Install)
2. run: katello-configure
3. run: rpm -qplv /var/www/html/pub/candlepin-cert-consumer-*noarch.rpm

Actual results:
-rw-rw-rw-    1 root    root  5385 Nov 12 16:21 /etc/rhsm/ca/candlepin-local.pem

Expected results:
-rw-r--r--    1 root    root  5385 Nov 12 16:21 /etc/rhsm/ca/candlepin-local.pem

Additional info:
katello-configure generates the RPM from within the certs::config puppet class:

  exec { "generate-candlepin-consumer-certificate":
    cwd       => "${katello_www_pub_dir}",
    command   => "gen-rpm.sh --name '${candlepin_consumer_name}' --version 1.0 --release 1 --packager None --vendor None --group 'Applications/System' --summary '${candlepin_consumer_summary}' --description '${candlepin_consumer_description}' --requires subscription-manager --post ${ssl_build_path}/rhsm-katello-reconfigure /etc/rhsm/ca/candlepin-local.pem:666=${ssl_build_path}/$candlepin_cert_name.crt 2>>${katello::params::configure_log_base}/certificates.log && /sbin/restorecon ./*rpm",
    path      => "/usr/share/katello/certs:/usr/bin:/bin",
    creates   => "${katello_www_pub_dir}/${candlepin_consumer_name}-1.0-1.noarch.rpm",
    require   => [Exec["generate-candlepin-certificate"], File["${ssl_build_path}/rhsm-katello-reconfigure"], File["${katello::params::configure_log_base}"]]
  }

In the middle of this command it passes in the permissions "666" to the gen-rpm.sh script, which get put into the RPM spec as the %attr for the CA cert file.

The gen-rpm.sh script is also used by katello-ssl-tool, but a quick test shows that this doesn't explicitly set the mode when it generates a CA RPM, so the RPM is generated with the file having default 644 permissions.

Comment 2 Kurt Seifried 2013-02-01 06:48:50 UTC
*** Bug 876580 has been marked as a duplicate of this bug. ***

Comment 3 Murray McAllister 2013-02-14 09:25:57 UTC
Acknowledgements:

This issue was discovered by Dominic Cleal and James Laska of Red Hat.

Comment 5 errata-xmlrpc 2013-02-21 19:07:24 UTC
This issue has been addressed in following products:

  CloudForms for RHEL 6

Via RHSA-2013:0547 https://rhn.redhat.com/errata/RHSA-2013-0547.html

Comment 6 Bryan Kearney 2013-02-22 13:43:28 UTC
commit 65f1e42b7bda0f3410931c50598540d944d8bf0d
Author: Marek Hulan <ares>
Date:   Tue Jan 22 12:48:10 2013 +0100

    877387 - Candlepin CA certificate mode in RPM
    
    File mode is set to 0644 when RPM is generated.

Comment 7 Martin Bacovsky 2013-02-22 14:38:37 UTC
Created attachment 701212 [details]
Fix for the permissions issue (in installer)

Comment 8 sthirugn@redhat.com 2013-03-20 16:01:14 UTC
Verified in SAM compose:

SAM 1.1 version:
* candlepin-0.6.5-1.el6_2.noarch
* candlepin-tomcat6-0.6.5-1.el6_2.noarch
* elasticsearch-0.18.4-11.el6.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.1.5-1.el6_2.noarch
* katello-cli-common-0.3.5-2.el6_2.noarch
* katello-cli-headpin-0.2.2-1.el6_2.noarch
* katello-common-0.3.3-1.el6_2.noarch
* katello-configure-0.3.7-1.el6_2.noarch
* katello-glue-candlepin-0.3.3-1.el6_2.noarch
* katello-headpin-0.2.13-1.el6_2.noarch
* katello-headpin-all-0.2.13-1.el6_2.noarch
* katello-selinux-0.2.4-1.el6_2.noarch
* thumbslug-0.0.24-1.el6_2.noarch

SAM 1.2.1 Version:
* candlepin-0.7.24-1.el6_3.noarch
* candlepin-cert-consumer-gizmo.idm.lab.bos.redhat.com-1.0-1.noarch
* candlepin-selinux-0.7.24-1.el6_3.noarch
* candlepin-tomcat6-0.7.24-1.el6_3.noarch
* elasticsearch-0.19.9-5.el6_3.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.2.1-1h.el6_3.noarch
* katello-cli-1.2.1-12h.el6_3.noarch
* katello-cli-common-1.2.1-12h.el6_3.noarch
* katello-common-1.2.1.1-1h.el6_4.noarch
* katello-configure-1.2.3.1-4h.el6_4.noarch
* katello-glue-candlepin-1.2.1.1-1h.el6_4.noarch
* katello-headpin-1.2.1.1-1h.el6_4.noarch
* katello-headpin-all-1.2.1.1-1h.el6_4.noarch
* katello-selinux-1.2.1-2h.el6_3.noarch
* thumbslug-0.0.28.1-1.el6_4.noarch
* thumbslug-selinux-0.0.28.1-1.el6_4.noarch

Comment 9 errata-xmlrpc 2013-03-26 19:17:15 UTC
This issue has been addressed in following products:

  Red Hat Subscription Asset Manager 1.2

Via RHSA-2013:0686 https://rhn.redhat.com/errata/RHSA-2013-0686.html

Comment 10 Kurt Seifried 2013-07-26 07:41:17 UTC
The Red Hat Security Response Team has rated this issue as having moderate security impact in CloudForms 1.1. This issue is not currently planned to be addressed in future updates.


Note You need to log in before you can comment on or make changes to this bug.