Executive brief
pam_usb is a tool that allows users to log into Linux systems using a USB drive instead of a password. A flaw in how the software handles memory errors can cause the login system to crash if the computer runs out of memory. This could allow an attacker to prevent legitimate users from logging in or using administrative commands like sudo, effectively locking them out of the system.
Technical details
The vulnerability is a NULL pointer dereference in src/mem.c. The software implemented out-of-memory (OOM) guards for xmalloc(), xrealloc(), and xstrdup() using assert() statements. Because many Linux distributions (including Debian, Fedora, and Arch) compile packages with the NDEBUG flag, these assertions are removed in production builds. Consequently, when memory allocation fails, the functions return NULL instead of aborting. Subsequent code dereferences these NULL pointers without checking, leading to a crash of the PAM module. If this occurs during a sudo or login attempt, it results in a local denial-of-service. The issue is fixed in version 0.9.0 by replacing assertions with explicit NULL checks and abort paths.
Affected products
- mcdope pam_usb < 0.9.0
Timeline
- 2026-05-20: advisory: GitHub Security Advisory published
- 2026-05-27: disclosed: CVE published to NVD
- 2026-05-27: patched: Fix released in version 0.9.0