Severity by source
AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:L
Local-only race requiring a low-privilege account and precise timing drives AV:L, AC:H, PR:L; pad state corruption enabling replay justifies I:H with minor C and A impact.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:H/A:L
Lifecycle Timeline
4DescriptionCVE.org
pam_usb provides hardware authentication for Linux using ordinary removable media. In versions prior to 0.9.2, when updating a one-time pad file, a temporary file is created using open() without the O_EXCL flag. Without O_EXCL, the create operation is not atomic: two concurrent processes racing to update the same pad may both succeed in opening the file, with the second write silently overwriting the first. The one-time pad is the core replay-prevention mechanism of pam_usb. A successful race could result in the stored pad value diverging from what either process expected, potentially causing authentication failures or, in a precisely timed attack, creating a window for pad reuse. This issue has been fixed in version 0.9.2.
AnalysisAI
Non-atomic one-time pad file creation in pam_usb prior to 0.9.2 exposes the core replay-prevention mechanism to a local race condition (CWE-362), allowing a precisely timed concurrent write to corrupt or reuse the stored OTP pad state. Systems running pam_usb as a PAM module for SSH, sudo, or login are affected on all versions before 0.9.2; successful exploitation could silently degrade hardware authentication integrity, creating a window for USB token replay attacks. No public exploit or CISA KEV listing has been identified at time of analysis; vendor-released patch 0.9.2 resolves this and 11 additional security findings.
Technical ContextAI
pam_usb is a Linux PAM (Pluggable Authentication Module) that authenticates users via removable USB media, using a one-time pad (OTP) stored in a flat file to prevent replay of previously observed USB tokens. The flaw resides in the pad update routine, which called open() to create a temporary file without the O_EXCL flag. O_EXCL makes file creation atomic - it fails if the file already exists - so its absence leaves a TOCTOU (Time-of-Check-Time-of-Use) window where two concurrent processes can both successfully open and write the same temporary file. The second write silently overwrites the first, leaving the on-disk pad state inconsistent with what either process expects. CWE-362 (Concurrent Execution using Shared Resource with Improper Synchronization) precisely describes this root cause. The affected CPE is cpe:2.3:a:mcdope:pam_usb:*:*:*:*:*:*:*:*, covering all versions before 0.9.2. The fix, confirmed in release notes as PR #380, adds O_EXCL to the pad temp file creation call to restore atomicity.
RemediationAI
Upgrade pam_usb to version 0.9.2 immediately; this release adds O_EXCL to the pad temp file creation call (PR #380) to atomize the operation and eliminate the race window. Version 0.9.2 is a broad security hardening release that simultaneously addresses 11 additional findings - including a TOCTOU race in pad directory creation (PR #381), symlink attack on the event device node, XXE in xmlReadFile, environment variable injection via getenv() in PAM context, and NULL dereference - making the upgrade strongly advisable beyond this single CVE. The release is available at https://github.com/mcdope/pam_usb/releases/tag/0.9.2. If immediate upgrade is not possible, restrict local shell access to the authenticating system so only highly trusted accounts can initiate concurrent PAM sessions, reducing the race opportunity; note this is a partial compensating control that does not eliminate the window. There is no known configuration toggle to disable the vulnerable code path without patching.
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
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,
Insecure deallocation in pam_usb 0.9.1 and below leaves sensitive authentication material - including one-time pad (OTP)
Same weakness CWE-362 – Race Condition
View allSame technique Race Condition
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-37935