Your business’ toughest competition might be criminal. See why.
Utility navigation bar redirect icon
Portal LoginSupportContact
Search
Close search
Huntress Logo in Teal
  • Platform Overview
    Managed EDR

    Get full endpoint visibility, detection, and response

    Managed EDR

    Get full endpoint visibility, detection, and response

    Managed ITDR

    Protect your Microsoft 365 identities and email environments.

    Managed ITDR

    Protect your Microsoft 365 identities and email environments.

    Managed SIEM

    Managed threat response and robust compliance support at a predictable price.

    Managed SIEM

    Managed threat response and robust compliance support at a predictable price.

    Managed Security Awareness Training

    Empower your teams with science-backed security awareness training.

    Managed Security Awareness Training

    Empower your teams with science-backed security awareness training.

    Integrations
    Integrations
    Support Documentation
    Support Documentation
    See Huntress in Action

    Quickly deploy and manage real-time protection for endpoints, email, and employees - all from a single dashboard.

    Huntress Cybersecurity
    See Huntress in Action

    Quickly deploy and manage real-time protection for endpoints, email, and employees - all from a single dashboard.

    Huntress Cybersecurity
  • Threats We Stop
    Phishing
    Phishing
    Business Email Compromise
    Business Email Compromise
    Ransomware
    Ransomware
    View Allright arrowView Allright arrow
    Industries We Serve
    Education
    Education
    Financial Services
    Financial Services
    State and Local Government
    State and Local Government
    Healthcare
    Healthcare
    Law Firms
    Law Firms
    Manufacturing
    Manufacturing
    Utilities
    Utilities
    View Allright arrowView Allright arrow
    Tailored Solutions
    MSPs
    MSPs
    Resellers
    Resellers
    SMBs
    SMBs
    Compliance
    Compliance
    Cybercriminals Have Evolved

    Get the intel on today’s cybercriminal groups and learn how to protect yourself.

    Huntress Cybersecurity
    Cybercriminals Have Evolved

    Get the intel on today’s cybercriminal groups and learn how to protect yourself.

    Huntress Cybersecurity
  • Pricing
  • Community Series
    The Product Lab

    Shape the next big thing in cybersecurity together.

    The Product Lab

    Shape the next big thing in cybersecurity together.

    Fireside Chat

    Real people. Real perspectives. Better conversations.

    Fireside Chat

    Real people. Real perspectives. Better conversations.

    Tradecraft Tuesday

    No products, no pitches – just tradecraft.

    Tradecraft Tuesday

    No products, no pitches – just tradecraft.

    _declassified

    Exposing hidden truths in the world of cybersecurity.

    _declassified

    Exposing hidden truths in the world of cybersecurity.

    Resources
    Upcoming Events
    Upcoming Events
    ebooks
    ebooks
    On-Demand Webinars
    On-Demand Webinars
    Videos
    Videos
    Whitepapers
    Whitepapers
    Datasheets
    Datasheets
    Cybersecurity Education
    Cybersecurity 101
    Cybersecurity 101
    Cybersecurity Guides
    Cybersecurity Guides
    Threat Library
    Threat Library
    Real Tradecraft, Real Results
    Real Tradecraft, Real Results
    2026 Cyber Threat Report
    2026 Cyber Threat Report
    The Huntress Blog
    Huntress Lands on the Microsoft Marketplace
    Huntress Cybersecurity
    Huntress Lands on the Microsoft Marketplace
    Huntress Cybersecurity
    How Huntress & DEFCERT Are Streamlining CMMC Assessment Prep
    Huntress Cybersecurity
    How Huntress & DEFCERT Are Streamlining CMMC Assessment Prep
    Huntress Cybersecurity
    Live Hacking Into Microsoft 365 with Kyle Hanslovan
    Huntress Cybersecurity
    Live Hacking Into Microsoft 365 with Kyle Hanslovan
    Huntress Cybersecurity
  • Why Huntress

    Go beyond AI in the fight against today’s hackers with Huntress Managed EDR purpose-built for your needs

    Huntress Cybersecurity
    Why Huntress

    Go beyond AI in the fight against today’s hackers with Huntress Managed EDR purpose-built for your needs

    Huntress Cybersecurity
    The Huntress SOC

    24/7 Security Operations Center

    The Huntress SOC

    24/7 Security Operations Center

    Reviews

    Why businesses of all sizes trust Huntress to defend their assets

    Reviews

    Why businesses of all sizes trust Huntress to defend their assets

    Case Studies

    Learn directly from our partners how Huntress has helped them

    Case Studies

    Learn directly from our partners how Huntress has helped them

    Community

    Get in touch with the Huntress Community team

    Community

    Get in touch with the Huntress Community team

    Compare Huntress
    Bitdefender
    Bitdefender
    Blackpoint
    Blackpoint
    Breach Secure Now!
    Breach Secure Now!
    Crowdstrike
    Crowdstrike
    Datto
    Datto
    SentinelOne
    SentinelOne
    Sophos
    Sophos
    Compare Allright arrowCompare Allright arrow
  • HUNTRESS HUB

    Login to access top-notch marketing resources, tools, and training.

    Huntress Cybersecurity
    HUNTRESS HUB

    Login to access top-notch marketing resources, tools, and training.

    Huntress Cybersecurity
    Partners
    MSPs

    Join our partner community to deliver expert-led managed security.

    MSPs

    Join our partner community to deliver expert-led managed security.

    Resellers

    Partner program designed to grow your cybersecurity business.

    Resellers

    Partner program designed to grow your cybersecurity business.

    Tech Alliances

    Driving innovation through global technology Partnerships

    Tech Alliances

    Driving innovation through global technology Partnerships

    Microsoft Partnership

    A Level-Up for Your Business Security

    Microsoft Partnership

    A Level-Up for Your Business Security

  • Press Release
    Huntress Announces Collaboration with Microsoft to Strengthen Cybersecurity for Businesses of All Sizes
    Huntress Cybersecurity
    Press Release
    Huntress Announces Collaboration with Microsoft to Strengthen Cybersecurity for Businesses of All Sizes
    Huntress Cybersecurity
    Our Story

    We're on a mission to shatter the barriers to enterprise-level security.

    Our Story

    We're on a mission to shatter the barriers to enterprise-level security.

    Newsroom

    Explore press releases, news articles, media interviews and more.

    Newsroom

    Explore press releases, news articles, media interviews and more.

    Meet the Team

    Founded by former NSA Cyber Operators. Backed by security researchers.

    Meet the Team

    Founded by former NSA Cyber Operators. Backed by security researchers.

    Careers

    Ready to shake up the cybersecurity world? Join the hunt.

    Careers

    Ready to shake up the cybersecurity world? Join the hunt.

    Awards
    Awards
    Contact Us
    Contact Us
  • Portal Login
  • Support
  • Contact
  • Search
  • Get a Demo
  • Start for Free
Portal LoginSupportContact
Search
Close search
Get a Demo
Start for Free
HomeThreat LibraryVulnerabilities
CVE-2021-4034

CVE-2021-4034 Vulnerability

Published: 2/20/2025

Written by: Nadine Rozell

Red caution sign overlaid on a picture of a laptop with a hand on the trackpad
Glitch effectGlitch effect

What is CVE-2021-4034 Vulnerability?

CVE-2021-4034 (PwnKit) is a memory corruption vulnerability in Polkit’s pkexec utility. Polkit is an application-level toolkit for controlling system-wide privileges in Unix-like operating systems. pkexec is a SUID-root program that lets an authorized user execute commands as another user, including the all-powerful root user. The vulnerability allows any unprivileged local user to gain full root privileges, effectively giving them the keys to the kingdom.

When was it discovered?

The vulnerability was discovered by researchers at Qualys and disclosed on January 25, 2022. The scary part? The bug had been hiding in plain sight for over 12 years, meaning a massive number of systems were vulnerable from the get-go. Patches were released quickly, but the long exposure time makes this a critical flaw to check for.

Affected Products & Versions

Product

Versions Affected

Fixed Versions / Patches

Polkit

All versions since 2009

Patches available for all major Linux distributions (e.g., Ubuntu, Debian, CentOS, Red Hat)

CVE-2021-4034 technical description

The PwnKit vulnerability is a classic case of improper input handling. The pkexec tool doesn't correctly process the number of command-line arguments it receives. By crafting a specific set of arguments, an attacker can trick pkexec into executing an arbitrary environment variable as a command. Because pkexec is a SUID-root binary, that command runs with root privileges. The exploit is reliable, architecture-independent, and works on default installations of most Linux distributions.

Tactics, Techniques & Procedures (TTPs)

An attacker first needs to gain initial access to a target machine as a low-privileged user. This could be through another exploit, a weak password, or a compromised web application. Once they have that foothold, they run the PwnKit exploit locally. It's a one-shot command. This immediately escalates their privileges to root, allowing them to disable security tools, install persistent backdoors, steal sensitive data, or pivot to other systems on the network.

Indicators of Compromise

Detection can be tricky since a successful exploit looks like a legitimate use of pkexec. However, logs may show pkexec being called with unusual or empty arguments. You might see entries in the system logs stating "The value for the SHELL variable was not found." A good EDR solution can flag the anomalous process execution chain. Running the pkexec --version command can also tell you if you're running a vulnerable version.

Known Proof-of-Concepts & Exploits

Proof-of-concept exploits for PwnKit became public almost immediately after disclosure. They are simple, highly reliable, and widely available. Malicious actors, including ransomware groups and APTs, quickly integrated PwnKit into their toolkits as a go-to method for privilege escalation on Linux systems.

How to detect CVE-2021-4034 Vulnerability?

The most reliable way to detect this vulnerability is to check your installed version of Polkit. You can do this using your distribution's package manager (e.g., apt show polkitd on Debian/Ubuntu, rpm -q polkit on Red Hat/CentOS). Vulnerability scanners like Nessus or Qualys also have specific plugins to detect PwnKit. On the host, you can look for the tell-tale log entries or use a local exploit checker script to test for the flaw.

Impact & risk of CVE-2021-4034 Vulnerability

The impact is severe. Gaining root access is the ultimate goal for an attacker on a single system. It grants them complete control. From there, they can do anything: deploy ransomware, exfiltrate an entire database, or use the compromised machine as a launchpad for further attacks within your network. For any organization running Linux servers, this vulnerability represents a critical risk to data integrity and system availability.

Mitigation & remediation strategies

Patch immediately. This is not a drill. All major Linux distributions have released patched versions of Polkit. Run your system updates (sudo apt update && sudo apt upgrade or sudo yum update). If you absolutely cannot patch a system right away, you can apply a temporary mitigation by removing the SUID bit from the pkexec binary (sudo chmod 0755 /usr/bin/pkexec). This will prevent the exploit from working but may break legitimate applications that rely on pkexec, so patching is always the better option.

CVE-2021-4034 Vulnerability FAQs

CVE-2021-4034, or PwnKit, is a local privilege escalation vulnerability in the pkexec tool on Linux. It lets any local user become the root user by exploiting a memory corruption flaw in how pkexec handles command-line arguments.

It doesn't infect a system, but rather exploits a flaw that's already there. An attacker with low-level access to a Linux machine runs a specially crafted command against pkexec. This command tricks the tool into executing code with root privileges, giving the attacker full control.

Yes. While patches are widely available, unpatched Linux systems are still common, especially in large, complex environments or with embedded devices. Attackers know this and continue to use PwnKit as a reliable way to escalate privileges after gaining an initial foothold.

The number one defense is patching. Update your Linux systems to ensure you have the fixed version of Polkit. Use vulnerability scanners to identify any systems that were missed. As a temporary fix, you can remove SUID permissions from pkexec, but this should only be a stop-gap measure.

Glitch effectBlurry glitch effect

Protect What Matters

Secure endpoints, email, and employees with the power of our 24/7 SOC. Try Huntress for free and deploy in minutes to start fighting threats.
Try Huntress for Free
Huntress Managed Security PlatformManaged EDRManaged EDR for macOSManaged EDR for LinuxManaged ITDRManaged SIEMManaged Security Awareness TrainingBook a Demo
PhishingComplianceBusiness Email CompromiseEducationFinanceHealthcareManufacturingState & Local Government
Managed Service ProvidersResellersIT & Security Teams24/7 SOCCase Studies
BlogResource CenterCybersecurity 101Upcoming EventsSupport Documentation
Our CompanyLeadershipNews & PressCareersContact Us
Huntress white logo

Protecting 215k+ customers like you with enterprise-grade protection.

Privacy PolicyCookie PolicyTerms of UseCookie Consent
Linkedin iconTwitter X iconYouTube iconInstagram icon
© 2025 Huntress All Rights Reserved.

Join the Hunt

Get insider access to Huntress tradecraft, killer events, and the freshest blog updates.

By submitting this form, you accept our Terms of Service & Privacy Policy