Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconGain local user account on target Linux system
-
DeliverySet XRDP_SESSION/DISPLAY/TMUX env vars to attacker-chosen values
-
ExploitInvoke sudo or su (setuid binary triggers PAM stack)
-
Installpam_usb calls getenv() and receives injected values
-
C2Session misclassified as remote or non-local by pam_usb logic
-
ExecuteHardware USB token check bypassed
-
ImpactExecute privileged commands without presenting USB device
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture External initialization of trusted vars
|
| Exploitation Conditions | Exploitation requires three specific conditions: (1) pam_usb must be installed and configured in the PAM stack for a setuid binary - specifically sudo or su - on a Linux system; (2) the attacker must hold a local user account with permission to invoke that setuid binary (PR:L); and (3) the attacker must manipulate the process environment to set one or more of XRDP_SESSION, DISPLAY, or TMUX to values that cause pam_usb's session-type check to return an unexpected classification before the setuid binary executes. Exploitation is strictly local (AV:L) - remote unauthenticated attackers cannot reach this code path directly. Environments where pam_usb is not installed, or where it is configured only for login flows that do not involve setuid binaries, are not affected. The AC:H rating reflects the requirement for successful environment pre-loading prior to PAM execution, not a cryptographic or race-condition hurdle. Systems where sudo is further restricted by SELinux or AppArmor policies that clean the environment may have additional protection. |
| Impact | The NVD CVSS 3.1 score of 6.3 Medium (AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N) accurately captures the local-only attack surface and elevated attack complexity, but the High confidentiality and integrity sub-scores reflect that a successful exploitation achieves a complete authentication bypass - potentially granting root via sudo without a hardware token. This creates a meaningful gap between the headline score and real-world impact: for any organization using pam_usb as a compensating control for privileged access, the functional risk is closer to High because the entire security guarantee of the module is nullified. No EPSS score was present in the input data, so exploitation probability cannot be quantified from base-rate statistics. The vulnerability is not listed in CISA KEV and no POC has been identified, suggesting exploitation has not been observed at scale. However, the attack concept is low in novelty - environment variable manipulation before setuid invocation is a well-understood local privilege escalation technique - and any local user familiar with PAM internals could independently develop an exploit. The AC:H rating is warranted but should not create false comfort: the 'high complexity' here refers to pre-loading the environment correctly, not defeating a cryptographic mechanism. |
| Exploit ScenarioDerived | A local user with a standard account sets XRDP_SESSION=1 (or manipulates DISPLAY or TMUX) in their shell environment, then invokes sudo to execute a privileged command. When pam_usb runs inside the sudo setuid process, getenv() returns the attacker-controlled value, causing the module to classify the session as a remote desktop or non-local session and alter its hardware token enforcement logic, allowing the command to proceed without presenting the required USB device. No public POC has been identified at time of analysis, but the technique mirrors well-known environment variable poisoning patterns against setuid binaries. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 18, 2026
Environment variable injection in pam_usb prior to version 0.9.2 allows a local authenticated user to bypass hardware USB token authentication by manipulating the XRDP_SESSION, DISPLAY, or TMUX environment variables before invoking setuid binaries such as sudo or su. Because the PAM module calls standard getenv() - which does not sanitize values in privileged contexts - attacker-controlled environment data is used to determine whether the current session is local or remote, potentially defeating the core purpose of hardware-enforced authentication. No public exploit has been identified at time of analysis and the vulnerability is not listed in CISA KEV, though the authentication bypass impact makes this a high-priority upgrade for any deployment relying on pam_usb for privileged command gating.
RemediationAI
Upgrade pam_usb to version 0.9.2 immediately; this release replaces getenv() with secure_getenv() in the PAM context (commit #384, issue #368), which is the direct fix for this vulnerability. The release is available at https://github.com/mcdope/pam_usb/releases/tag/0.9.2 and is described by the vendor as a strongly recommended upgrade. If immediate patching is blocked, a targeted compensating control is to restrict the set of local users permitted to invoke pam_usb-protected setuid binaries - for example, tightening the sudo ruleset to limit which accounts can trigger the vulnerable PAM stack - though this narrows rather than eliminates the attack surface. Additionally, administrators may audit PAM configuration to temporarily remove pam_usb from sudo and su stacks if hardware token enforcement is not strictly required for those paths, accepting the trade-off of reduced authentication assurance until the upgrade is applied. Note that version 0.9.2 also addresses 11 other security findings including TOCTOU races, XXE, symlink-following, and infinite-loop DoS; patching resolves all of these simultaneously.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
pam_usb is a Linux Pluggable Authentication Module (PAM) that enforces hardware-based authentication using removable USB media, identified by CPE cpe:2.3:a:mcdope:pam_usb:*:*:*:*:*:*:*:*. The root cause is CWE-454 (Use of Externally-Controlled Input to Select Classes or Code): the module calls the POSIX standard getenv() to read XRDP_SESSION, DISPLAY, and TMUX in order to classify a session as local or remote and conditionally enforce hardware token requirements. The critical flaw is that getenv() returns attacker-supplied values from the inherited process environment when the module runs inside a setuid binary (sudo, su), because the POSIX standard does not require getenv() to be safe in privilege-escalation contexts. The correct POSIX substitute, secure_getenv() - implemented in the fix commit #384 - returns NULL whenever the real and effective UID/GID differ, blocking untrusted environment data from influencing security decisions. The 0.9.2 release addresses 12 independent security findings uncovered during an ongoing audit, indicating the vulnerability is part of a broader hardening effort rather than an isolated defect.
Know when Pam Usb gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N
Local vector and low-privilege requirement reflect mandatory local account and environment manipulation before setuid execution; C:H/I:H capture full auth bypass enabling root access via sudo.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
pam_usb provides hardware authentication for Linux using removable media. In versions prior to 0.9.2, getenv() environment variables XRDP_SESSION, DISPLAY and TMUX allow environment variable injection into local-check logic. These environment variables influence whether a current session is local or remote, and a PAM module that runs in the context of setuid binaries (sudo, su), getenv() returns attacker-controlled values whenever the process environment has been manipulated by a local user. This issue has been fixed in version 0.9.2.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Authentication bypass in pam_usb before 0.9.1 allows remote unauthenticated attackers to reach the USB hardware-authenti
pam_usb versions 0.8.0 through 0.9.2 fail to recognize compressed-notation IPv6 addresses when evaluating the optional d
The deny_remote safeguard in pam_usb fails open on link-local IPv6 sessions, causing a remote login to be classified as
pam_usb through 0.9.2 can be pushed past its explicit XRDP deny rule by a local user who simply unsets the XRDP_SESSION
Authentication bypass in pam_usb prior to 0.9.0 lets a local user defeat the USB hardware-authentication factor by delet
XXE injection in pam_usb prior to 0.9.2 enables an attacker with write access to the root-owned configuration file to tr
Heap buffer overflow in pam_usb prior to 0.9.1 allows a local attacker with high privileges to corrupt heap memory on 32
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
Non-atomic one-time pad file creation in pam_usb prior to 0.9.2 exposes the core replay-prevention mechanism to a local
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
EUVD-2026-37937
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB