A critical local privilege escalation (LPE) vulnerability, dubbed Pack2TheRoot, has been identified in the PackageKit daemon. This flaw poses a significant risk to Linux environments by allowing unprivileged local users to manipulate the system's package management backend. Successful exploitation grants attackers root-level permissions, enabling them to install malicious software, remove security controls, or establish persistent backdoors.
For defenders, this is a high-priority issue. While local access is required, threat actors frequently combine LPE vulnerabilities with initial access vectors—such as exploiting web application vulnerabilities or exploiting unverified user input—to fully compromise a host. If your organization runs Linux distributions utilizing PackageKit (e.g., Fedora, RHEL, CentOS, Ubuntu), immediate action is required to audit and patch affected systems.
Technical Analysis
Affected Component: PackageKit (packagekitd) Platform: Linux distributions where PackageKit is installed and enabled. Attack Vector: Local Privilege Escalation
Vulnerability Mechanics: PackageKit is a system service designed to abstract package management (yum, dnf, apt, etc.) via a D-Bus interface. The Pack2TheRoot flaw stems from a security issue within the daemon's handling of D-Bus method calls. Specifically, the daemon fails to adequately verify the authorization context of the calling user for certain sensitive operations, such as installing or removing packages.
By invoking the D-Bus interface—often via the command-line tool pkcon or custom scripts—a low-privileged user can trigger PackageKit to execute package installation commands with root (uid 0) privileges. This effectively bypasses the standard PolicyKit (polkit) authorization prompts that would typically require an administrator's password.
Impact:
- Root Access: The attacker obtains full control over the operating system.
- Persistence: Attackers can install malicious RPM/DEB packages or compromised binaries.
- Defense Evasion: Security agents or logging tools can be uninstalled or disabled.
Exploitation Status: As of this reporting, Proof-of-Concept (PoC) code demonstrating the ability to trigger package installation is available. While active mass exploitation has not been confirmed, the simplicity of the attack vector increases the likelihood of rapid adoption in targeted operations and insider threat scenarios.
Detection & Response
Detecting this vulnerability requires identifying when the PackageKit daemon executes high-privilege package operations on behalf of non-root users. Standard package updates usually require explicit authorization; unauthorized or automated package installation via PackageKit is a strong indicator of compromise or exploitation.
Sigma Rules
---
title: Pack2TheRoot - Suspicious PackageKit Install via pkcon
id: 8c4b2f10-1a3b-4d7f-9e5e-6f8a9b2c3d4e
status: experimental
description: Detects attempts to install packages using the PackageKit command-line interface (pkcon) by non-root users, indicative of Pack2TheRoot exploitation.
references:
- https://bleepingcomputer.com/news/security/new-pack2theroot-flaw-gives-hackers-root-linux-access/
author: Security Arsenal
date: 2024/04/12
tags:
- attack.privilege_escalation
- attack.t1068
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith: '/pkcon'
CommandLine|contains:
- 'install'
- 'remove'
filter_main_root:
User|contains: 'root'
condition: selection and not filter_main_root
falsepositives:
- Legitimate administrative use by sudo users (should be rare)
level: high
---
title: Pack2TheRoot - PackageKit Daemon Spawning Package Managers
id: 9d5c3e21-2b4c-5e8g-0f6f-7g9b0c3d4e5f
status: experimental
description: Detects the PackageKit daemon spawning backend package managers (yum, dnf, apt) without a parent console session, suggesting automated or unauthorized installation.
references:
- https://bleepingcomputer.com/news/security/new-pack2theroot-flaw-gives-hackers-root-linux-access/
author: Security Arsenal
date: 2024/04/12
tags:
- attack.privilege_escalation
- attack.t1068
logsource:
category: process_creation
product: linux
detection:
selection_parent:
ParentImage|endswith: '/packagekitd'
selection_child:
Image|endswith:
- '/yum'
- '/dnf'
- '/apt'
- '/apt-get'
CommandLine|contains:
- 'install'
filter_main_authorized:
User|contains: 'root'
condition: selection_parent and selection_child and not filter_main_authorized
falsepositives:
- Legitimate system updates initiated by authorized users (rare without explicit TTY)
level: high
KQL (Microsoft Sentinel / Defender)
// Hunt for suspicious pkcon usage or PackageKit spawning package managers
DeviceProcessEvents
| where Timestamp > ago(1d)
| where ((FolderPath endswith @"/pkcon" and ProcessCommandLine has_any ("install", "remove"))
or
(InitiatingProcessFolderPath endswith @"/packagekitd" and
FolderPath has_any (@"/yum", @"/dnf", @"/apt", @"/apt-get") and
ProcessCommandLine has "install"))
| where AccountName != "root"
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, FileName, ProcessCommandLine
| extend AlertDetail = "Potential Pack2TheRoot Exploitation"
Velociraptor VQL
-- Hunt for pkcon execution or packagekitd spawning install commands
SELECT
Pid,
Name AS ProcessName,
CommandLine,
Username,
Exe,
Parent.Pid AS ParentPid,
Parent.Name AS ParentName
FROM pslist()
WHERE Name = 'pkcon' AND CommandLine =~ '(install|remove)'
OR (Parent.Name = 'packagekitd' AND Name =~ '(yum|dnf|apt|apt-get)' AND CommandLine =~ 'install')
Remediation Script (Bash)
#!/bin/bash
# Remediation script for Pack2TheRoot (PackageKit LPE)
# Check PackageKit version and apply updates
echo "[*] Checking PackageKit installation and version..."
if command -v rpm &> /dev/null; then
rpm -qa | grep packagekit
echo "[*] Attempting to update PackageKit via yum/dnf..."
yum update packagekit -y || dnf update packagekit -y
elif command -v dpkg &> /dev/null; then
dpkg -l | grep packagekit
echo "[*] Attempting to update PackageKit via apt..."
apt-get update && apt-get install --only-upgrade packagekit -y
else
echo "[!] Package manager not found or PackageKit not installed."
fi
echo "[*] Verifying PackageKit service status..."
systemctl status packagekit --no-pager || true
# Temporary Mitigation: Stop the service if patching is not immediately possible
# WARNING: This will break graphical package management for users.
# echo "[*] Stopping PackageKit service as mitigation..."
# systemctl stop packagekit
# systemctl disable packagekit
echo "[!] Review logs for evidence of exploitation: journalctl -u packagekit"
Remediation
To address the Pack2TheRoot vulnerability, administrators should take the following steps immediately:
-
Patch Immediately: Apply the latest security updates provided by your distribution vendor. Check for updates specifically targeting
packagekit.- RHEL/CentOS/Fedora:
sudo dnf update packagekit - Ubuntu/Debian:
sudo apt-get install --only-upgrade packagekit
- RHEL/CentOS/Fedora:
-
Verify Update: Reboot the system or restart the PackageKit service to ensure the new binary is loaded.
sudo systemctl restart packagekit -
Review Logs: Audit system logs (
/var/log/syslog,/var/log/messages, orjournalctl -u packagekit) for recent unauthorized package installation attempts. Look for entries wherepackagekitdexecutedyumoraptcommands outside of scheduled maintenance windows. -
Restrict Access (If patching is delayed): As a temporary workaround, consider stopping and disabling the PackageKit service on servers where graphical package management is not required. This prevents the daemon from accepting D-Bus requests. bash sudo systemctl stop packagekit sudo systemctl disable packagekit
Related Resources
Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub
Is your security operations ready?
Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.