Bug 1964114 (CVE-2021-35938) - CVE-2021-35938 rpm: races with chown/chmod/capabilities calls during installation
Summary: CVE-2021-35938 rpm: races with chown/chmod/capabilities calls during installa...
Keywords:
Status: NEW
Alias: CVE-2021-35938
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On: 1969327 1969328 1969329 1969798 1969799 1969800 1971278 1971279 1971280 1971281 1977844 2003064 2070453
Blocks: 1964123 1977372
TreeView+ depends on / blocked
 
Reported: 2021-05-24 18:25 UTC by msiddiqu
Modified: 2024-02-05 10:56 UTC (History)
11 users (show)

Fixed In Version: rpm 4.18.0
Doc Type: If docs needed, set a value
Doc Text:
A symbolic link issue was found in rpm. It occurs when rpm sets the desired permissions and credentials after installing a file. A local unprivileged user could use this flaw to exchange the original file with a symbolic link to a security-critical file and escalate their privileges on the system. The highest threat from this vulnerability is to data confidentiality and integrity as well as system availability.
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2024:0667 0 None None None 2024-02-02 07:05:43 UTC
Red Hat Product Errata RHBA-2024:0674 0 None None None 2024-02-05 10:56:03 UTC
Red Hat Product Errata RHSA-2024:0424 0 None None None 2024-01-24 16:48:32 UTC
Red Hat Product Errata RHSA-2024:0435 0 None None None 2024-01-24 15:26:15 UTC
Red Hat Product Errata RHSA-2024:0453 0 None None None 2024-01-24 16:40:08 UTC
Red Hat Product Errata RHSA-2024:0463 0 None None None 2024-01-24 16:30:41 UTC
Red Hat Product Errata RHSA-2024:0582 0 None None None 2024-01-30 13:24:41 UTC
Red Hat Product Errata RHSA-2024:0647 0 None None None 2024-02-01 12:29:33 UTC

Description msiddiqu 2021-05-24 18:25:07 UTC
When RPM installs a file/directory, it uses path-based operations afterwards to set the desired permissions and credentials. When the directory this is happening in is owned by an unprivileged user, that user can escalate privileges to root by exchanging the file/directory with a symbolic link to a security-critical file/directory.

References: 
 
https://bugzilla.suse.com/show_bug.cgi?id=1157880

Comment 9 Mauro Matteo Cascella 2021-06-30 15:21:42 UTC
Created rpm tracking bugs for this issue:

Affects: fedora-all [bug 1977844]

Comment 10 Mauro Matteo Cascella 2021-07-07 15:17:17 UTC
This flaw, along with CVE-2021-35937 and CVE-2021-35939, belong to a set of complex issues that may allow an unprivileged user to trick RPM into modifying root-owned files during installation, due to race conditions and/or symlink attacks. These issues do not have a solution upstream. Fixing would require rather involved refactoring of RPM internals.

Note that in this context, unprivileged users are actually system accounts (like the pcpqa user mentioned in one of the SUSE bugs) that are usually more tightly controlled than ordinary users. In general, access to files and directories installed by RPMs requires high privileges. Regular users should not be allowed to manipulate RPM artifacts during installation. A local attacker would first need to compromise a system account in order to exploit these flaws, thus reducing the overall impact considerably.

Comment 14 Panu Matilainen 2022-05-13 07:35:54 UTC
This is considered fixed in RPM 4.18 (https://rpm.org/wiki/Releases/4.18.0) which is currently in alpha stage of the release process, final version is expected in Q3.

Comment 18 errata-xmlrpc 2024-01-24 15:26:12 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.0 Extended Update Support

Via RHSA-2024:0435 https://access.redhat.com/errata/RHSA-2024:0435

Comment 19 errata-xmlrpc 2024-01-24 16:30:39 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2024:0463 https://access.redhat.com/errata/RHSA-2024:0463

Comment 20 errata-xmlrpc 2024-01-24 16:40:06 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9.2 Extended Update Support

Via RHSA-2024:0453 https://access.redhat.com/errata/RHSA-2024:0453

Comment 21 errata-xmlrpc 2024-01-24 16:48:31 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.6 Extended Update Support

Via RHSA-2024:0424 https://access.redhat.com/errata/RHSA-2024:0424

Comment 22 errata-xmlrpc 2024-01-30 13:24:39 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.8 Extended Update Support

Via RHSA-2024:0582 https://access.redhat.com/errata/RHSA-2024:0582

Comment 23 errata-xmlrpc 2024-02-01 12:29:32 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2024:0647 https://access.redhat.com/errata/RHSA-2024:0647


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