polkit pkexec empty-argv environment corruption (PwnKit, CVE-2021-4034)
Run with an empty argument vector, the setuid-root pkexec reads and then writes argv[1], which aliases the environment, reintroducing a stripped variable (GCONV_PATH) to gain local root. Nicknamed PwnKit (a pun on polkit), it sat unnoticed for over twelve years and affects nearly every Linux distribution.
- Product
- polkit (pkexec)
- Vendor
- The polkit project (freedesktop.org)
- Affected
- All polkit versions shipping pkexec, since its introduction in May 2009 (NVD: polkit before 0.120 / fixed in 121). pkexec is present by default on essentially every Linux distribution.
- Fixed in
- Upstream commit a2bf5c9c (Jan Rybar, 2022-01-25), released as polkit 121, with distribution backports the same week
- Weakness
- CWE-787
- CVSS vector
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Published
- 28 Jan 2022
Classified as
References
Related CVEs
- CVE-2023-4911high 7.82023
Looney Tunables: glibc ld.so GLIBC_TUNABLES buffer overflow
The loader's tunables parser copies each recognized name=value pair into a fixed-size buffer, but a malformed name=name=value string is parsed and appended twice, overflowing the buffer during setuid startup.
- CVE-2026-46300high 7.82026
Fragnesia: Linux shared-fragment marker loss
Socket-buffer coalescing can transfer page-backed fragment descriptors without their shared marker, causing later ESP processing to decrypt shared data in place.
- CVE-2024-2961high 8.82024
glibc iconv ISO-2022-CN-EXT out-of-bounds write
Converting to a multibyte charset, one escape-sequence path skips its output-bounds check, writing up to 3 fixed bytes past the buffer.
- CVE-2023-5217high 8.82023
libvpx VP8 encoder heap overflow on thread/height reconfigure
A per-row worker array sized from the current frame height is only reallocated when threads exceed one, so a reconfigure that drops to a single thread while growing the frame leaves it undersized and the encoder writes past it.