The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2021-4034

CVE-2021-4034: Polkit pkexec Privilege Escalation Flaw

CVE-2021-4034 is a privilege escalation vulnerability in Polkit's pkexec utility that allows unprivileged users to gain administrative rights. This article covers the technical details, affected versions, and mitigations.

Published: March 4, 2026

CVE-2021-4034 Overview

CVE-2021-4034, commonly known as "PwnKit," is a critical local privilege escalation vulnerability discovered in polkit's pkexec utility. The pkexec application is a setuid tool designed to allow unprivileged users to run commands as privileged users according to predefined policies. This vulnerability exists because the current version of pkexec doesn't handle the calling parameters count correctly and ends up trying to execute environment variables as commands. An attacker can leverage this by crafting environment variables in such a way that it induces pkexec to execute arbitrary code, allowing unprivileged users to gain administrative rights on the target machine.

Critical Impact

This vulnerability enables any local unprivileged user to gain full root privileges on vulnerable Linux systems. It has been actively exploited in the wild and is listed in CISA's Known Exploited Vulnerabilities catalog.

Affected Products

  • Polkit Project polkit (all versions prior to patch)
  • Red Hat Enterprise Linux (versions 6.0, 7.0, 8.0 and related variants)
  • Canonical Ubuntu Linux (14.04, 16.04, 18.04, 20.04, 21.10)
  • SUSE Linux Enterprise Server and Desktop
  • Oracle HTTP Server and ZFS Storage Appliance Kit
  • Siemens SINUMERIK Edge and SCALANCE LPE9403

Discovery Timeline

  • 2022-01-28 - CVE CVE-2021-4034 published to NVD
  • 2025-11-06 - Last updated in NVD database

Technical Details for CVE-2021-4034

Vulnerability Analysis

This vulnerability stems from an out-of-bounds memory access issue in the pkexec binary. The flaw occurs during the argument parsing phase when pkexec is executed. When pkexec is invoked without any command-line arguments (argc equals 0), the program incorrectly processes memory beyond the bounds of the argv array. Due to how Linux processes organize memory, the argv and envp arrays are contiguous in memory, meaning that when pkexec reads past the end of argv, it actually reads from the beginning of the environment variables (envp).

The vulnerability allows an attacker to manipulate environment variables to inject a malicious shared library path. When pkexec attempts to resolve the "command" to execute (which is actually reading from envp due to the bug), it can be tricked into loading and executing attacker-controlled code with elevated privileges.

Root Cause

The root cause is an out-of-bounds write vulnerability (CWE-787) combined with an out-of-bounds read (CWE-125) in the argument handling code of pkexec. The program fails to properly validate that argc is greater than zero before accessing argv[1]. When argc is 0, the program reads from argv[1], which points to the first environment variable. Subsequently, the program writes to argv[1], which corrupts the envp array.

This design flaw has existed in the codebase since the initial commit of pkexec in May 2009, meaning the vulnerability has been present in virtually all Linux distributions that ship with polkit for over 12 years.

Attack Vector

The attack requires local access to the target system. An attacker must be able to execute code as an unprivileged user on the system. The exploitation involves:

  1. Creating a malicious shared library that will be loaded by pkexec
  2. Setting up environment variables to control the GCONV_PATH used by glibc
  3. Executing pkexec with no arguments (argc=0) using the execve() system call
  4. The corrupted environment variables cause pkexec to load the attacker's malicious shared library with root privileges

The attack is highly reliable and does not require any user interaction. Multiple proof-of-concept exploits are publicly available, including via Exploit-DB.

Detection Methods for CVE-2021-4034

Indicators of Compromise

  • Unusual executions of /usr/bin/pkexec with no command-line arguments
  • Creation of suspicious directories matching patterns like /tmp/GCONV_PATH=/tmp/.exploit/ or similar directory structures designed to exploit gconv module loading
  • Unexpected shared library files (.so files) appearing in temporary directories
  • Process ancestry showing privilege escalation from unprivileged user to root via pkexec

Detection Strategies

  • Monitor process execution events for pkexec invocations where argc equals 0 or the command line appears empty
  • Implement file integrity monitoring on /usr/bin/pkexec to detect any unauthorized modifications
  • Use endpoint detection solutions to identify suspicious parent-child process relationships involving pkexec
  • Alert on the creation of directories or files containing GCONV_PATH strings in temporary locations

Monitoring Recommendations

  • Enable comprehensive audit logging for setuid binary executions using auditd rules targeting /usr/bin/pkexec
  • Deploy behavioral detection rules that identify the characteristic attack pattern of environment variable manipulation followed by privilege escalation
  • Correlate authentication logs with process execution logs to identify unauthorized privilege escalations
  • Implement real-time alerting for any root shell spawned from pkexec without corresponding authentication events

How to Mitigate CVE-2021-4034

Immediate Actions Required

  • Update polkit to a patched version immediately; consult your distribution's security advisories for specific version numbers
  • If patching is not immediately possible, remove the SUID bit from pkexec using chmod 0755 /usr/bin/pkexec as a temporary measure
  • Audit systems for signs of exploitation by reviewing process execution logs and checking for suspicious temporary files
  • Prioritize patching systems that allow local user access, especially multi-user systems and shared compute environments

Patch Information

Patches have been released by all major Linux distributions. The official fix is available in the polkit GitLab repository. Vendor-specific security advisories and patches are available from:

  • Red Hat Security Bulletin RHSB-2022-001
  • Oracle CPU April 2022
  • SUSE Knowledge Base Article

Workarounds

  • Remove the SUID bit from pkexec by running chmod 0755 /usr/bin/pkexec (note: this will break functionality that depends on pkexec for privilege elevation)
  • Restrict access to vulnerable systems by limiting which users can obtain local shell access
  • Implement application whitelisting to prevent execution of unauthorized binaries in temporary directories
  • Use SELinux or AppArmor policies to restrict pkexec behavior if available on your distribution
bash
# Temporary mitigation: Remove SUID bit from pkexec
chmod 0755 /usr/bin/pkexec

# Verify the change
ls -la /usr/bin/pkexec
# Should show: -rwxr-xr-x (not -rwsr-xr-x)

# Alternative: Use auditd to monitor pkexec usage
auditctl -a always,exit -F path=/usr/bin/pkexec -F perm=x -k pkexec_execution

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypePrivilege Escalation

  • Vendor/TechPolkit

  • SeverityHIGH

  • CVSS Score7.8

  • EPSS Probability86.73%

  • Known ExploitedYes
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CISA KEV Information
  • In CISA KEVYes
  • CWE References
  • CWE-787

  • CWE-125
  • Technical References
  • Packet Storm Privilege Escalation

  • Packet Storm Privilege Escalation

  • Siemens Security Advisory

  • SecPod Local Privilege Escalation Blog

  • StarWind Security Announcement

  • SUSE Knowledge Base Article

  • Vicarius Blog on PwnKit

  • CISA Known Exploited Vulnerability Catalog
  • Vendor Resources
  • Red Hat Security Vulnerability

  • Red Hat Bug Report

  • Freedesktop Git Commit

  • Oracle Security Alerts

  • Qualys CVE-2021-4034 Analysis
  • Related CVEs
  • CVE-2021-3560: Polkit Privilege Escalation Vulnerability

  • CVE-2026-4897: Polkit Denial of Service Vulnerability

  • CVE-2025-14338: Polkit Race Condition Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English