Bug 1264790 (CVE-2015-5284) - CVE-2015-5284 ipa: ipa-kra-install includes certificate and private key in world readable file
Summary: CVE-2015-5284 ipa: ipa-kra-install includes certificate and private key in wo...
Alias: CVE-2015-5284
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 1264793
Blocks: 1264794
TreeView+ depends on / blocked
Reported: 2015-09-21 08:46 UTC by Martin Prpič
Modified: 2023-05-12 18:36 UTC (History)
8 users (show)

Fixed In Version: ipa 4.2.2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-10-08 11:45:54 UTC

Attachments (Terms of Use)
Proposed patch (5.27 KB, patch)
2015-09-21 10:48 UTC, Jan Cholasta
no flags Details | Diff
Proposed patch (5.03 KB, patch)
2015-09-21 12:39 UTC, Jan Cholasta
mbasti: review+
Details | Diff

Description Martin Prpič 2015-09-21 08:46:26 UTC
It was discovered that ipa-kra-install puts the CA agent certificate and private key to a world readable file, /etc/httpd/alias/kra-agent.pem. This allows users on an IPA server where ipa-kra-install was run to issue arbitrary certificates with the IPA CA.

The ipa-kra-install script configures the KRA subsystem of Dogtag, which is used for the Password Vault feature of IPA. During the configuration process, a KRA agent user account is created in Dogtag, which is used by IPA to authenticate to the KRA. Currently the KRA agent uses the same certificate and private key as the CA agent, which IPA uses to authenticate to the CA.

The kra-agent.pem file is necessary because the Dogtag client Python library does not support using a certificate and private key from a NSS database for authentication, so it is not possible to use the CA agent certificate and private key directly from their primary location, which is the NSS database at /etc/httpd/alias.

Comment 2 Martin Prpič 2015-09-21 08:56:04 UTC

This issue did not affect the versions of ipa as shipped with Red Hat Enterprise Linux 6 and 7 as they did not include the affected KRA subsystem.

Comment 3 Martin Prpič 2015-09-21 09:53:19 UTC

This issue was discovered by Jan Cholasta of Red Hat.

Comment 4 Jan Cholasta 2015-09-21 10:48:38 UTC
Created attachment 1075455 [details]
Proposed patch

See attachment for a patch fixing the issue.

Comment 5 Jan Cholasta 2015-09-21 12:39:21 UTC
Created attachment 1075511 [details]
Proposed patch

Found a copy & paste issue in the patch, updated patch attached.

Comment 6 Martin Bašti 2015-09-22 06:51:08 UTC
The updated patch works for me, ACK.

Comment 7 Simo Sorce 2015-09-22 22:05:32 UTC
Patch looks good to me.

Comment 8 Tomas Hoger 2015-09-25 11:37:20 UTC
Just to explicitly confirm, do the upgrade.py part of the patch take care of automatically fixing existing installations that already have the file with bad permissions?  I see ipa-server's %posttrans runs ipa-server-upgrade.  Is no manual action required after that?

Comment 9 Martin Bašti 2015-09-25 11:45:27 UTC
Yes, upgrade will fix permissions on file, no manual action is needed.

Comment 10 Tomas Hoger 2015-09-25 11:53:43 UTC
Affected functionality was introduced in IPA 4.2.  Therefore, this issue did not affect IPA versions as shipped with Red Hat Enterprise Linux 6 and 7.  The new IPA 4.2 is part of Red Hat Enterprise Linux 7.2 Beta and it is planned to be addressed before the final release of Red Hat Enterprise Linux 7.2.

Comment 11 Jan Cholasta 2015-09-30 05:24:28 UTC
Actually, the certificate is not revoked during the upgrade, so anyone with a copy of kra-agent.pem can still authenticate with it after the upgrade. To prevent this, the private key and certificate must be manually replaced after the upgrade.

Comment 12 Tomas Hoger 2015-10-08 11:42:46 UTC
Lifting embargo.

Comment 13 Tomas Hoger 2015-10-08 11:45:54 UTC
No released Red Hat Enterprise Linux or Fedora version was affected by this flaw.

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