CWE
59
Advisory Published
CVE Published
Updated

CVE-2021-35939

First published: Mon May 24 2021(Updated: )

In response to <a href="https://access.redhat.com/security/cve/CVE-2017-7500">CVE-2017-7500</a> and <a href="https://access.redhat.com/security/cve/CVE-2017-7501">CVE-2017-7501</a>, it was decided that the policy of RPM is "Only follow directory symlinks owned by target directory owner or root." [1]. This check was only implemented for the parent directory of the file to be created. If an untrusted user owns another ancestor directory, the problem remains unfixed. An actual exploit requires that a similar directory structure exists both at the location where RPM operates and for the files the attacker wants to get control over. Packages with such paths do exist in the real world, however. For example, in openSUSE both matomo and icinga2 ship a 'Pdo/Mysql.php' somewhere in the file system, with different ownership. A compromised 'matomo' user can create a symlink /srv/www/matomo/core/Tracker/Db -&gt; /usr/share/icingaweb2/library/vendor/Zend/Db/Adapter/ and on the next update of matomo, RPM would replace the 'Pdo/Mysql.php' of icinga2 and give ownership of it to the 'matomo' user. A fix for this requires a messy ball of code using O_PATH to manually walk the whole directory structure and manually resolving symlinks, like in [1] and [2]. References: 1: <a href="https://github.com/systemd/systemd/blob/a5648b809457d120500b2acb18b31e2168a4817a/src/basic/fs-util.c#L716">https://github.com/systemd/systemd/blob/a5648b809457d120500b2acb18b31e2168a4817a/src/basic/fs-util.c#L716</a> 2: <a href="https://build.suse.de/package/view_file/SUSE:Maintenance:13179/permissions.SUSE_SLE-15-SP1_Update/0007-chkstat-fix-privesc-CVE-2019-3690.patch?expand=1">https://build.suse.de/package/view_file/SUSE:Maintenance:13179/permissions.SUSE_SLE-15-SP1_Update/0007-chkstat-fix-privesc-CVE-2019-3690.patch?expand=1</a> 3. <a href="https://bugzilla.suse.com/show_bug.cgi?id=1157883">https://bugzilla.suse.com/show_bug.cgi?id=1157883</a>

Credit: secalert@redhat.com

Affected SoftwareAffected VersionHow to fix
Rpm Rpm<4.18
Redhat Enterprise Linux=8.0
redhat/rpm<4.18.0
4.18.0

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

  • What is CVE-2021-35939?

    CVE-2021-35939 is a vulnerability that allows a local unprivileged user to potentially gain root privileges on certain Linux systems.

  • Which software is affected by CVE-2021-35939?

    The affected software includes RPM version up to 4.18.0 on Red Hat Enterprise Linux 8.0.

  • What is the severity of CVE-2021-35939?

    CVE-2021-35939 has a severity rating of medium with a CVSS score of 6.7.

  • How can an attacker exploit CVE-2021-35939?

    An attacker with local unprivileged access who owns an ancestor directory can exploit this vulnerability to gain root privileges.

  • Is there a fix available for CVE-2021-35939?

    Yes, a fix is available for CVE-2021-35939. It is recommended to update to RPM version 4.18.0 or later.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2024 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203