CVE-2026-48983: pam_usb Symlink Race Condition in Pad Directory Creation
pam_usb is a Linux authentication tool that uses USB devices or removable media as a hardware security key. A timing vulnerability allows a local attacker with basic user privileges to manipulate how the system creates directories that store authentication data. By exploiting a narrow window between the system checking if a directory exists and actually creating it, an attacker can trick pam_usb into writing sensitive authentication tokens to a location under their control. This could expose future authentication codes or prevent legitimate users from logging in. The vulnerability was fixed in version 0.9.2.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 5.8 MEDIUM · CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:L
- Weaknesses (CWE)
- CWE-367
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-06-18 / 2026-06-22
NVD description (verbatim)
pam_usb provides hardware authentication for Linux using ordinary removable media. In versions prior to 0.9.2, a symlink race condition exists in per-device and per-user pad directory creation. pam_usb uses a check-then-act pattern: it calls lstat() to test for existence and then calls mkdir() separately to create the directory. A local attacker can win the race between these calls by replacing the target path with a symlink to a directory they control. If successful, one-time pad files may be written to an attacker-controlled location, potentially exposing future pad values before use or disrupting authentication. This issue has been fixed in version 0.9.2.
2 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
CVE-2026-48983 is a symlink race condition (CWE-367) affecting pam_usb's directory creation logic for per-device and per-user pad storage. The vulnerability stems from a classic time-of-check-time-of-use (TOCTOU) flaw: pam_usb calls lstat() to verify whether a directory exists, then calls mkdir() to create it as a separate operation. An unprivileged local attacker can win the race by replacing the target path with a symlink pointing to an attacker-controlled directory between these two calls. Successful exploitation results in one-time pad files being written to the attacker's chosen location, potentially disclosing future authentication values or disrupting the authentication flow. The vulnerability requires local access and moderate timing precision but does not require elevated privileges to trigger. Version 0.9.2 remedies this by implementing atomic directory creation or proper symlink handling.
Business impact
Organizations deploying pam_usb for multi-factor authentication on Linux systems face a localized but meaningful authentication bypass risk. A compromised or malicious local user can exfiltrate future one-time pad values, undermining the security guarantee of the hardware token and potentially enabling account takeover. Alternatively, exploitation could cause authentication denial of service, locking legitimate users out of their systems. The impact is scoped to systems where pam_usb is actively used for login authentication and where untrusted local users have shell access—common in shared hosting, educational labs, or enterprise workstations. Remediation is straightforward and non-disruptive.
Affected systems
Any Linux system running pam_usb versions prior to 0.9.2 is affected. The vulnerability requires local system access, so it primarily threatens shared or multi-user Linux environments, containerized systems where users have shell access, or insider-threat scenarios. Systems with strict local access controls or running pam_usb in single-user mode face lower practical risk. The vulnerability does not affect Windows or macOS systems, nor does it impact pam_usb deployments where removable media authentication is configured but not actively used for login.
Exploitability
This vulnerability requires local access and basic user-level privileges—no root or special capabilities are needed to attempt exploitation. However, the attack is not trivial: the attacker must win a race condition with precise timing, creating a symlink at exactly the right moment in the directory creation sequence. Successful exploitation depends on factors like system load, filesystem latency, and the attacker's ability to monitor or predict when pam_usb will attempt directory creation. While a motivated attacker can reliably trigger this with a simple loop-based script, it is not an one-shot exploit. The vulnerability is not currently listed on CISA's Known Exploited Vulnerabilities catalog, and no public weaponized proof-of-concept has been widely distributed, but the underlying race condition is well-understood in the security literature.
Remediation
Upgrade pam_usb to version 0.9.2 or later. Verify the upgrade through your package manager or by downloading directly from the pam_usb project repository. No configuration changes or system reboots are strictly necessary, but restarting the PAM service or logging out and back in will ensure the patched code is active. Organizations unable to patch immediately should restrict local shell access to trusted users only and monitor filesystem activity in the pam_usb directory for unexpected symlinks or ownership changes.
Patch guidance
To patch: (1) Check your current pam_usb version using `pamtester --version` or `grep -r 'VERSION' /path/to/pam_usb/source`. (2) Obtain version 0.9.2 or later from the official pam_usb project or your Linux distribution's package repository. (3) Install via your package manager (e.g., `apt upgrade libpam-usb`, `yum update pam_usb`) or compile from source if necessary. (4) Verify successful installation by checking the version again. (5) Test authentication with a known USB device to confirm functionality. No rollback is anticipated, and the fix is backward-compatible with existing pad files. For enterprise deployments, schedule patching in your standard change window; the patch is low-risk and does not require downtime.
Detection guidance
Monitor for signs of exploitation: (1) Check for unexpected symlinks in pam_usb's pad directory (typically `~/.pam_usb/devices/` or `/etc/security/pam_usb/devices/`). (2) Review filesystem audit logs for failed mkdir() calls or lstat() operations on pam_usb paths followed by symlink creation from other processes. (3) Monitor for authentication failures coinciding with local user activity, particularly if a user is repeatedly attempting to access the same authenticated account. (4) Use tools like `auditctl` or `inotifywait` to log access to the pad directory and alert on unexpected writes. (5) Check file ownership and permissions: pad files should be owned by the authenticating user and not world-readable. If you detect anomalies, review local user activity logs and consider temporarily disabling pam_usb authentication pending investigation.
Why prioritize this
This vulnerability merits prompt but not emergency patching. While it requires local access and precise timing, it directly undermines hardware-based authentication—a key security control in many Linux environments. The CVSS score of 5.8 (MEDIUM) reflects the combination of high confidentiality impact (exposure of future pad values) and moderate integrity/availability impact (disrupted authentication). Organizations running pam_usb in multi-user or shared environments should prioritize patching within 1–2 weeks. Single-user systems or isolated environments can defer patching if local access is tightly controlled. The lack of active exploitation in the wild provides a narrow window to patch before adversaries develop targeted tools.
Risk score, explained
CVSS 3.1 score 5.8 (MEDIUM) is derived from: (1) Attack Vector: Local (requires system access, ruling out network attacks). (2) Attack Complexity: High (timing-dependent race condition, not easily automated). (3) Privileges Required: Low (unprivileged user can exploit). (4) User Interaction: None (no end-user interaction needed). (5) Confidentiality Impact: High (one-time pad values may be exposed, compromising future authentication). (6) Integrity Impact: Low (attacker can write to a controlled location but cannot directly modify system files). (7) Availability Impact: Low (authentication may be disrupted but system availability is not compromised). The MEDIUM rating is appropriate: this is not a remote code execution or privilege escalation vector, but it does weaken a critical authentication mechanism for local users.
Frequently asked questions
Does this vulnerability affect systems that use pam_usb only for login and not for other authentication scenarios?
Yes. Regardless of whether pam_usb is used for login, sudo, or other PAM services, the directory creation race condition exists whenever pam_usb initializes a pad directory. An attacker can exploit it during any authentication event. Patching is necessary for all pam_usb installations, not just login-specific deployments.
Can I disable pam_usb temporarily to mitigate this risk while waiting for a patch?
Yes. Temporarily commenting out or removing the pam_usb entry from your PAM configuration files (typically in /etc/pam.d/) will prevent the vulnerability from being triggered. However, this will also disable hardware token authentication until you patch and re-enable it. This approach is suitable for short-term risk reduction in high-sensitivity environments.
If I patch pam_usb, do I need to regenerate my USB authentication tokens or device configuration?
No. Version 0.9.2 is backward-compatible with existing pad files and device configurations. After patching, your existing USB devices and one-time pad databases remain valid and require no regeneration. Simply upgrade the software, verify the new version is running, and test authentication.
How does this vulnerability differ from other PAM module weaknesses I should be aware of?
This vulnerability is specific to pam_usb's handling of filesystem operations. Unlike some PAM vulnerabilities that involve authentication bypass or privilege escalation, this flaw is a race condition that affects data confidentiality and authentication availability. It underscores the importance of atomic filesystem operations in security-critical code and applies best practices demonstrated in other PAM modules that properly handle directory creation.
This analysis is provided for informational purposes and reflects information available as of the publication date. While we strive for accuracy, vulnerability details and patch status may change. Always verify patch availability and version numbers against official vendor advisories and release notes before deployment. This page does not constitute security advice for your specific environment; consult your security team and conduct your own testing before applying patches or making configuration changes. SEC.co makes no warranties regarding the completeness or timeliness of this information. Source: NVD (public-domain), retrieved 2026-07-27. Analysis generated by SEC.co (claude-haiku-4-5).
Weaknesses (CWE)
Related vulnerabilities
- CVE-2025-59610MEDIUMQualcomm Memory Corruption via IOCTL API Version Mismatch – Patch Guidance
- CVE-2026-20454MEDIUMMediaTek geniezone Race Condition Privilege Escalation (CVSS 6.4)
- CVE-2026-41568MEDIUMDocker & Moby Race Condition in docker cp Mount Setup
- CVE-2026-45619MEDIUMWWBN AVideo DNS-Rebinding SSRF Vulnerability
- CVE-2026-45647MEDIUMMicrosoft Defender for Endpoint Privilege Escalation Race Condition
- CVE-2026-46159MEDIUMLinux btrfs TOCTOU Race Condition Information Disclosure
- CVE-2026-46194MEDIUMLinux F2FS Extent Node Race Condition Leading to Kernel Crash
- CVE-2026-49958MEDIUMHermes WebUI TOCTOU Race Condition Arbitrary File Deletion