REDHAT-BUG-2585412: High severity Linux-PAM Linux-PAM vulnerability
A flaw was found in Linux-PAM's pameconf configuration handling. When Linux-PAM is built with libeconf and an empty vendor directory, the search list passed to libeconf becomes "PARSINGDIRS=(null):/etc": the NULL vendor directory is formatted as the literal text "(null)", which libeconf opens as a directory relative to the current working directory. A local user can create a "(null)" directory with environment.d drop-ins in a world-writable folder (e.g. /tmp); when an administrator runs sudo from that folder, pamenv loads the attacker's variables, including LDPRELOAD, which bypass sudo's envreset filtering (the PAM environment is merged unconditionally) and reach the command run as root, leading to full local privilege escalation. Confirmed by code review and reproduced end to end (marker payload ran as uid=0 euid=0 via sudo from a world-writable directory) in a Fedora 44 container with the shipped pam 1.7.2-2.fc44; Fedora 43-45 and rawhide are affected, Fedora 42 (EOL) as well. RHEL is not affected (pam 1.5.1/1.6.1 lack the affected code path).
Affected Software
Event History
Frequently Asked Questions
Which systems are affected?
Fedora 43 through 45 and rawhide are affected, and Fedora 42 is also affected but is end of life. RHEL is not affected because its PAM versions lack the affected code path.
What does an attacker need to exploit this?
The attacker needs local access and the ability to create a directory named "(null)" containing environment.d drop-ins in a world-writable location, such as /tmp. An administrator must then run sudo with that location as the current working directory.
How does the issue bypass sudo environment filtering?
pam_env loads attacker-controlled environment variables from the relative "(null)" directory. The PAM environment is merged into the command environment unconditionally, allowing variables such as LD_PRELOAD to reach a command executed as root despite sudo's env_reset filtering.