Severity by source
AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N
Local access only; high complexity requires chaining with a use-after-free or heap inspection primitive; low privilege sufficient; confidentiality impact only via OTP pad recovery.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N
Lifecycle Timeline
3DescriptionCVE.org
pam_usb provides hardware authentication for Linux using ordinary removable media. In versions 0.9.1 and below, the xfree() memory release helper in calls free() without first zeroing the buffer contents, releasing heap-allocated buffers containing sensitive data - including one-time pad bytes read from disk - without clearing, leaving the sensitive content in freed heap memory until it happens to be overwritten by a subsequent allocation. On a system where a use-after-free condition exists, or where a heap inspection primitive becomes available, this could allow recovery of pad values or other authentication material from freed memory regions. This is a defence-in-depth requirement consistent with prior hardening work in this codebase (GHSA-vx6f-rrqr-j87c applied explicit_bzero to some pad paths; this issue generalises the pattern to the central deallocation helper).
AnalysisAI
Insecure deallocation in pam_usb 0.9.1 and below leaves sensitive authentication material - including one-time pad (OTP) bytes read from removable media - resident in freed heap memory because the xfree() helper calls free() without first zeroing the buffer. On any system where a secondary use-after-free condition or heap inspection primitive is present within the same pam_usb process, an attacker could recover pad values or other credential material from those freed regions, potentially undermining the hardware authentication guarantee pam_usb is designed to provide. This is a defense-in-depth hardening gap patched in 0.9.2; no confirmed active exploitation or public exploit code has been identified at time of analysis.
Technical ContextAI
pam_usb is a Linux PAM (Pluggable Authentication Module) that uses ordinary removable USB storage as a second authentication factor, relying on one-time pad (OTP) files stored on the device to challenge-response authenticate users. The flaw maps to CWE-14 (Compiler Removal of Code to Clear Buffers): the central xfree() deallocation helper wraps free() without invoking a compiler-resistant clearing function such as explicit_bzero() or memset_s() first. Because optimizing compilers may strip a plain memset() call before free(), CWE-14 specifically mandates a compiler-barrier-safe clearing function. Prior hardening work (GHSA-vx6f-rrqr-j87c) had already applied explicit_bzero to certain specific OTP pad code paths, but the generalized xfree() helper - used throughout the codebase for all heap deallocations - was left unpatched, meaning any heap buffer passed through xfree() (credentials, paths, pad bytes) retains its contents in freed heap until a subsequent allocation happens to overwrite it. The affected CPE is cpe:2.3:a:mcdope:pam_usb:*:*:*:*:*:*:*:* covering all versions through 0.9.1.
RemediationAI
Vendor-released patch: pam_usb 0.9.2. The 0.9.2 release explicitly fixes xfree() to clear heap memory before calling free(), preventing sensitive authentication material from lingering in freed regions; release artifacts and notes are available at https://github.com/mcdope/pam_usb/releases/tag/0.9.2. The upgrade is strongly recommended by the vendor because the same release also addresses eleven additional security findings including TOCTOU races on the OTP pad directory, XXE injection via xmlReadFile(), environment variable injection in PAM context, symlink-following attacks on evdev nodes, and compiler/linker hardening gaps - collectively reducing the attack surface that could be chained to exploit this residual-data issue. If immediate upgrade is not possible, a compensating control is to restrict ptrace access for unprivileged users by setting kernel.yama.ptrace_scope=2 (via sysctl), which limits the heap inspection primitives available to local attackers; this does not eliminate the underlying residual data exposure but raises the bar for accessing freed memory. Additionally, ensuring process isolation (no shared address space, no coredump paths accessible to low-privilege users) reduces the window of exploitation.
Authentication bypass in pam_usb before 0.9.1 allows remote unauthenticated attackers to reach the USB hardware-authenti
Authentication bypass in pam_usb prior to 0.9.0 lets a local user defeat the USB hardware-authentication factor by delet
Heap buffer overflow in pam_usb prior to 0.9.1 allows a local attacker with high privileges to corrupt heap memory on 32
XXE injection in pam_usb prior to 0.9.2 enables an attacker with write access to the root-owned configuration file to tr
XPath injection in pam_usb prior to 0.9.0 allows unauthenticated remote attackers to manipulate device-verification quer
PATH hijacking in pam_usb helper tools prior to version 0.9.0 allows a local low-privileged attacker who can manipulate
Environment variable injection in pam_usb prior to version 0.9.2 allows a local authenticated user to bypass hardware US
Symlink race condition in pam_usb prior to 0.9.2 allows a local attacker to redirect one-time pad files to an attacker-c
Non-atomic one-time pad file creation in pam_usb prior to 0.9.2 exposes the core replay-prevention mechanism to a local
Concurrent PAM invocations in pam_usb prior to 0.9.1 expose a process-wide static pointer race condition in src/log.c, w
NULL pointer dereference in pam_usb 0.9.1 and below crashes PAM-integrated authentication services (sudo, login) when lo
Infinite loop denial-of-service in pam_usb 0.9.1 and earlier can permanently hang authentication processes such as sudo,
Same weakness CWE-14 – Compiler Removal of Code to Clear Buffers
View allSame technique Information Disclosure
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-37922