CVE Vulnerabilities

CVE-2021-4034

Out-of-bounds Read

Published: Jan 28, 2022 | Modified: Jun 28, 2024
CVSS 3.x
7.8
HIGH
Source:
NVD
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS 2.x
7.2 HIGH
AV:L/AC:L/Au:N/C:C/I:C/A:C
RedHat/V2
RedHat/V3
7.8 IMPORTANT
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Ubuntu
HIGH

A local privilege escalation vulnerability was found on polkits 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 doesnt 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 itll 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.

Weakness

The product reads data past the end, or before the beginning, of the intended buffer.

Affected Software

Name Vendor Start Version End Version
Polkit Polkit_project * 121 (excluding)
Red Hat Enterprise Linux 6 Extended Lifecycle Support RedHat polkit-0:0.96-11.el6_10.2 *
Red Hat Enterprise Linux 7 RedHat polkit-0:0.112-26.el7_9.1 *
Red Hat Enterprise Linux 7.3 Advanced Update Support RedHat polkit-0:0.112-12.el7_3.1 *
Red Hat Enterprise Linux 7.4 Advanced Update Support RedHat polkit-0:0.112-12.el7_4.2 *
Red Hat Enterprise Linux 7.6 Advanced Update Support RedHat polkit-0:0.112-18.el7_6.3 *
Red Hat Enterprise Linux 7.6 Telco Extended Update Support RedHat polkit-0:0.112-18.el7_6.3 *
Red Hat Enterprise Linux 7.6 Update Services for SAP Solutions RedHat polkit-0:0.112-18.el7_6.3 *
Red Hat Enterprise Linux 7.7 Advanced Update Support RedHat polkit-0:0.112-22.el7_7.2 *
Red Hat Enterprise Linux 7.7 Telco Extended Update Support RedHat polkit-0:0.112-22.el7_7.2 *
Red Hat Enterprise Linux 7.7 Update Services for SAP Solutions RedHat polkit-0:0.112-22.el7_7.2 *
Red Hat Enterprise Linux 8 RedHat polkit-0:0.115-13.el8_5.1 *
Red Hat Enterprise Linux 8.1 Update Services for SAP Solutions RedHat polkit-0:0.115-9.el8_1.2 *
Red Hat Enterprise Linux 8.2 Extended Update Support RedHat polkit-0:0.115-11.el8_2.2 *
Red Hat Enterprise Linux 8.4 Extended Update Support RedHat polkit-0:0.115-11.el8_4.2 *
Red Hat Virtualization 4 for Red Hat Enterprise Linux 7 RedHat redhat-virtualization-host-0:4.3.21-20220126.0.el7_9 *
Red Hat Virtualization 4 for Red Hat Enterprise Linux 8 RedHat redhat-virtualization-host-0:4.4.10-202202081536_8.5 *
Policykit-1 Ubuntu bionic *
Policykit-1 Ubuntu devel *
Policykit-1 Ubuntu esm-infra/xenial *
Policykit-1 Ubuntu focal *
Policykit-1 Ubuntu hirsute *
Policykit-1 Ubuntu impish *
Policykit-1 Ubuntu jammy *
Policykit-1 Ubuntu trusty/esm *

Potential Mitigations

  • Assume all input is malicious. Use an “accept known good” input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
  • When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, “boat” may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as “red” or “blue.”
  • Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code’s environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • To reduce the likelihood of introducing an out-of-bounds read, ensure that you validate and ensure correct calculations for any length argument, buffer size calculation, or offset. Be especially careful of relying on a sentinel (i.e. special character such as NUL) in untrusted inputs.

References