CVE-2021-4034: Red Hat Polkit Out-of-Bounds Read and Write Vulnerability

Published Nov 23, 2021
·
Updated

A Local Privilege Escalation vulnerability (from any user to root) was found in polkit's pkexec, a SUID-root program that is installed by default on every major Linux distribution.

Other sources

A local privilege escalation vulnerability was found on polkit's pkexec utility. The pkexec application is a setuid tool designed to allow unprivileged users to run commands as privileged users according predefined policies. The current version of pkexec doesn't handle the calling parameters count correctly and ends trying to execute environment variables as commands. An attacker can leverage this by crafting environment variables in such a way it'll induce pkexec to execute arbitrary code. When successfully executed the attack can cause a local privilege escalation given unprivileged users administrative rights on the target machine.

The Red Hat polkit pkexec utility contains an out-of-bounds read and write vulnerability that allows for privilege escalation with administrative rights.

CISA

Affected Software

70 affected componentsFixes available
redhat/polkit<0:0.96-11.el6_10.2
0:0.96-11.el6_10.2
redhat/polkit<0:0.112-26.el7_9.1
0:0.112-26.el7_9.1
redhat/polkit<0:0.112-12.el7_3.1
0:0.112-12.el7_3.1
redhat/polkit<0:0.112-12.el7_4.2
0:0.112-12.el7_4.2
redhat/polkit<0:0.112-18.el7_6.3
0:0.112-18.el7_6.3
redhat/polkit<0:0.112-22.el7_7.2
0:0.112-22.el7_7.2
redhat/polkit<0:0.115-13.el8_5.1
0:0.115-13.el8_5.1
redhat/polkit<0:0.115-9.el8_1.2
0:0.115-9.el8_1.2
redhat/polkit<0:0.115-11.el8_2.2
0:0.115-11.el8_2.2
redhat/polkit<0:0.115-11.el8_4.2
0:0.115-11.el8_4.2
redhat/redhat-virtualization-host<0:4.3.21-20220126.0.el7_9
0:4.3.21-20220126.0.el7_9
Red Hat Polkit
Polkit Project Polkit<121
redhat Enterprise Linux Server Update Services For Sap Solutions=7.6
redhat Enterprise Linux Server Update Services For Sap Solutions=7.7
redhat Enterprise Linux=8.0
redhat Enterprise Linux Desktop=7.0
redhat Enterprise Linux Eus=8.2
redhat Enterprise Linux For Ibm Z Systems=7.0
redhat Enterprise Linux For Ibm Z Systems=8.0
redhat Enterprise Linux For Ibm Z Systems Eus=8.2
redhat Enterprise Linux For Ibm Z Systems Eus=8.4
redhat Enterprise Linux For Power Big Endian=7.0
redhat Enterprise Linux For Power Little Endian=7.0
redhat Enterprise Linux For Power Little Endian=8.0
redhat Enterprise Linux For Power Little Endian Eus=8.1
redhat Enterprise Linux For Power Little Endian Eus=8.2
redhat Enterprise Linux For Power Little Endian Eus=8.4
redhat Enterprise Linux For Scientific Computing=7.0
redhat Enterprise Linux Server=6.0
redhat Enterprise Linux Server=7.0
redhat Enterprise Linux Server Aus=7.3
redhat Enterprise Linux Server Aus=7.4
redhat Enterprise Linux Server Aus=7.6
redhat Enterprise Linux Server Aus=7.7
redhat Enterprise Linux Server Aus=8.2
redhat Enterprise Linux Server Aus=8.4
redhat Enterprise Linux Server Eus=8.4
redhat Enterprise Linux Server Tus=7.6
redhat Enterprise Linux Server Tus=7.7
redhat Enterprise Linux Server Tus=8.2
redhat Enterprise Linux Server Tus=8.4
redhat Enterprise Linux Server Update Services For Sap Solutions=8.1
redhat Enterprise Linux Server Update Services For Sap Solutions=8.2
redhat Enterprise Linux Server Update Services For Sap Solutions=8.4
redhat Enterprise Linux Workstation=7.0
Canonical Ubuntu Linux=14.04
Canonical Ubuntu Linux=16.04
Canonical Ubuntu Linux=18.04
Canonical Ubuntu Linux=20.04
Canonical Ubuntu Linux=21.10
SUSE Enterprise Storage=7.0
SUSE Linux Enterprise High Performance Computing=15.0-sp2
SUSE Manager Proxy=4.1
SUSE Manager Server=4.1
SUSE Linux Enterprise Desktop=15-sp2
SUSE Linux Enterprise Server=15-sp2
SUSE Linux Enterprise Server Sap=15-sp2
SUSE Linux Enterprise Workstation Extension=12-sp5
Oracle HTTP Server=12.2.1.3.0
Oracle HTTP Server=12.2.1.4.0
Oracle ZFS Storage Appliance Kit=8.8
Siemens Sinumerik Edge<3.3.0
Siemens Scalance Lpe9403 Firmware<2.0
Siemens SCALANCE LPE9403
Starwindsoftware Command Center=1.0-update3_build5871
Starwindsoftware Starwind Hyperconverged Appliance
Starwindsoftware Starwind Virtual San=v8-build14338
All of the following
Siemens Scalance Lpe9403 Firmware<2.0
Siemens SCALANCE LPE9403

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/polkit to a version that resolves this vulnerability.

    Fixed in 0:0.96-11.el6_10.2
  2. Upgrade

    Upgrade redhat/polkit to a version that resolves this vulnerability.

    Fixed in 0:0.112-26.el7_9.1
  3. Upgrade

    Upgrade redhat/polkit to a version that resolves this vulnerability.

    Fixed in 0:0.112-12.el7_3.1
  4. Upgrade

    Upgrade redhat/polkit to a version that resolves this vulnerability.

    Fixed in 0:0.112-12.el7_4.2
  5. Upgrade

    Upgrade redhat/polkit to a version that resolves this vulnerability.

    Fixed in 0:0.112-18.el7_6.3
  6. Upgrade

    Upgrade redhat/polkit to a version that resolves this vulnerability.

    Fixed in 0:0.112-22.el7_7.2
  7. Upgrade

    Upgrade redhat/polkit to a version that resolves this vulnerability.

    Fixed in 0:0.115-13.el8_5.1
  8. Upgrade

    Upgrade redhat/polkit to a version that resolves this vulnerability.

    Fixed in 0:0.115-9.el8_1.2
  9. Upgrade

    Upgrade redhat/polkit to a version that resolves this vulnerability.

    Fixed in 0:0.115-11.el8_2.2
  10. Upgrade

    Upgrade redhat/polkit to a version that resolves this vulnerability.

    Fixed in 0:0.115-11.el8_4.2
  11. Upgrade

    Upgrade redhat/redhat-virtualization-host to a version that resolves this vulnerability.

    Fixed in 0:4.3.21-20220126.0.el7_9
  12. Configuration

    Create a systemtap script named pkexec-block.stp with the provided contents that probe process("/usr/bin/pkexec").function("main"), raise(9), and then rmmod stap_pkexec_block.

    systemtap script script name pkexec blocking = pkexec-block.stp
  13. Compensating control

    Mitigate the polkit pkexec local privilege escalation on systems that cannot be updated and do NOT have Secure Boot enabled by using the provided systemtap procedure (requires installing the referenced systemtap packages/dependencies, installing polkit debuginfo, creating pkexec-block.stp, loading the generated systemtap kernel module, verifying it is loaded, and removing it after polkit is updated).

  14. Operational

    Install required systemtap packages and dependencies as referenced in the Red Hat solution 5441 (access.redhat.com/solutions/5441).

  15. Operational

    Install polkit debug information (debuginfo) by running: debuginfo-install polkit.

  16. Operational

    Load the systemtap generated kernel module into the running kernel and ensure it is loaded by running: stap -g -F -m stap_pkexec_block pkexec_block.stp, then verify with: lsmod | grep -i stap_pkexec_block.

  17. Operational

    After polkit is updated to the version containing the fix, remove the systemtap-generated kernel module by running the command shown in the mitigation text (rmmod stap_pkexec_block / removal step referenced as part of the provided procedure).

Event History

Nov 23, 2021
Data Sourced
via Red Hat·09:16 AM
DescriptionSeverityAffected Software
Jan 25, 2022
CVE Published
05:00 PM
Jan 28, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionWeakness
Data Sourced
via NVD·08:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jun 27, 2022
Known Exploited
via CISA·12:00 AM
Oct 3, 2024
News Published
via BleepingComputer·02:33 PM
News Published
via BleepingComputer·02:35 PM
Jun 18, 2026
News Published
via Dark Reading·07:09 PM
News Published
via Dark Reading·07:33 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2021-4034?

CVE-2021-4034 is considered a high severity vulnerability that allows for local privilege escalation.

2

How do I fix CVE-2021-4034?

To fix CVE-2021-4034, update the polkit package to a version that is patched, such as 0:0.96-11.el6_10.2 or higher for Red Hat systems.

3

What causes CVE-2021-4034?

CVE-2021-4034 is caused by an out-of-bounds read and write vulnerability within the pkexec utility of the polkit package.

4

Which systems are affected by CVE-2021-4034?

CVE-2021-4034 affects multiple versions of Red Hat Enterprise Linux and systems using the polkit package, particularly versions prior to the fix releases.

5

Can CVE-2021-4034 be exploited remotely?

No, CVE-2021-4034 requires local access to exploit, as it involves privilege escalation using a setuid tool.

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.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203