Root code execution via inherited ZSH environment
Published May 13, 2024 · Updated Apr 2, 2026
Local privilege escalation in PackageKit in Apple macOS before 14.5 allows local users to execute code as root via a ZSH-based PKG. PackageKit starts PKG scripts as root while retaining the current user's environment, causing ZSH to load attacker-controlled commands from that user's .zshenv file. Exploitation requires code execution in the user's context and a user-initiated installation of a PKG whose script uses ZSH; MDM- and Munki-driven installations are not exposed.
Summary
What happened
Local privilege escalation in PackageKit in Apple macOS before 14.5 allows local users to execute code as root via a ZSH-based PKG. PackageKit starts PKG scripts as root while retaining the current user's environment, causing ZSH to load attacker-controlled commands from that user's .zshenv file. Exploitation requires code execution in the user's context and a user-initiated installation of a PKG whose script uses ZSH; MDM- and Munki-driven installations are not exposed.
The record
- CVE
- CVE-2024-27822
- Published
- May 13, 2024
- Updated
- Apr 2, 2026
- Vendor
- Apple
- Product
- macOS
- Classifications
- CWE-277, T1068
- Attack vector
- local
- Privileges
- authenticated
Timeline
How it unfolded
- May 13, 2024CVE publishedPublication date reported by the CVE source.
- Apr 2, 2026Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=0 <14.5
What conditions does exploitation require?
What is affected?
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- pkg_exploit.pyfunctional · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo