Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1039811 - (CVE-2013-6435) CVE-2013-6435 rpm: race condition during the installation process
CVE-2013-6435 rpm: race condition during the installation process
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
high Severity high
: ---
: ---
Assigned To: Red Hat Product Security
impact=important,public=20141209,repo...
: Security
Depends On: 1163052 1163053 1163054 1163055 1163056 1163057 1163058 1163059 1163060 1163061 1172125
Blocks: 1039813
  Show dependency treegraph
 
Reported: 2013-12-09 23:12 EST by Murray McAllister
Modified: 2015-03-18 04:18 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
It was found that RPM wrote file contents to the target installation directory under a temporary name, and verified its cryptographic signature only after the temporary file has been written completely. Under certain conditions, the system interprets the unverified temporary file contents and extracts commands from it. This could allow an attacker to modify signed RPM files in such a way that they would execute code chosen by the attacker during package installation.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-12-18 23:48:19 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
rpm-4.8.0-CVE-2013-6435.patch (version without umask) (2.67 KB, patch)
2014-11-11 05:17 EST, Florian Weimer
no flags Details | Diff
rpm-4.8.0-CVE-2013-6435.patch (version with umask) (1003 bytes, patch)
2014-11-11 07:23 EST, Florian Weimer
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2014:1974 normal SHIPPED_LIVE Important: rpm security update 2014-12-09 18:07:29 EST
Red Hat Product Errata RHSA-2014:1975 normal SHIPPED_LIVE Important: rpm security update 2014-12-09 18:07:03 EST
Red Hat Product Errata RHSA-2014:1976 normal SHIPPED_LIVE Important: rpm security update 2014-12-09 19:50:38 EST

  None (edit)
Description Murray McAllister 2013-12-09 23:12:37 EST
IssueDescription:

It was found that RPM wrote file contents to the target installation directory under a temporary name, and verified its cryptographic signature only after the temporary file has been written completely. Under certain conditions, the system interprets the unverified temporary file contents and extracts commands from it. This could allow an attacker to modify signed RPM files in such a way that they would execute code chosen by the attacker during package installation.

Acknowledgements:

This issue was discovered by Florian Weimer of the Red Hat Product Security Team.
Comment 17 Florian Weimer 2014-11-11 05:17:21 EST
Created attachment 956207 [details]
rpm-4.8.0-CVE-2013-6435.patch (version without umask)

Proposed patch for RPM 4.8.

This is based on Panu's suggestion in comment #8, but creates the file with mode 0 instead, instead of using chmod afterwards, closing yet another race.
Comment 24 Florian Weimer 2014-11-11 07:23:40 EST
Created attachment 956268 [details]
rpm-4.8.0-CVE-2013-6435.patch (version with umask)

This variant of the patch is smaller than the previous one.  The RPM transaction code is not thread-safe already, so another umask call should not be a problem.
Comment 25 Panu Matilainen 2014-11-11 07:46:09 EST
Yeah, that is short and sweet, and trivial to backport. 

Except that there is no rpmfiFSizeIndex() in < 4.8.x versions, but should be easy enough to replace with direct struct access.
Comment 29 Huzaifa S. Sidhpurwala 2014-12-09 07:50:40 EST
Created rpm tracking bugs for this issue:

Affects: fedora-all [bug 1172125]
Comment 30 errata-xmlrpc 2014-12-09 13:08:00 EST
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6.5 EUS - Server and Compute Node Only
  Red Hat Enterprise Linux 6.4 EUS - Server and Compute Node Only
  Red Hat Enterprise Linux 5.6 Long Life
  Red Hat Enterprise Linux 5.9 EUS - Server Only
  Red Hat Enterprise Linux 6.2 AUS

Via RHSA-2014:1975 https://rhn.redhat.com/errata/RHSA-2014-1975.html
Comment 31 errata-xmlrpc 2014-12-09 13:08:17 EST
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6
  Red Hat Enterprise Linux 5

Via RHSA-2014:1974 https://rhn.redhat.com/errata/RHSA-2014-1974.html
Comment 32 errata-xmlrpc 2014-12-09 14:50:55 EST
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2014:1976 https://rhn.redhat.com/errata/RHSA-2014-1976.html
Comment 33 Fedora Update System 2014-12-16 23:46:12 EST
rpm-4.12.0.1-4.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 34 Fedora Update System 2014-12-29 04:57:21 EST
rpm-4.11.3-2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 35 Thomas Jarosch 2015-01-22 06:37:40 EST
Is it intentional that the fix for fc22 as in "rpm-4.12.0.1-6.fc22.src.rpm"

does not contain the line

+    rpm_loff_t left = rpmfiFSizeIndex(fsmGetFi(fsm), fsm->ix);

from Florian's patch?
Comment 36 Karel Srot 2015-03-18 03:55:53 EDT
Hi Florian, 
could you please take a look at #c35?
Comment 37 Panu Matilainen 2015-03-18 04:18:18 EDT
It is intentional, rpm 4.12 code already does that for other reasons.

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