Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain high-privilege local access
-
DeliveryWrite crafted config with large n_devices
-
ExploitTrigger pam_usb config parsing (login attempt)
-
ExecutionInteger overflow wraps allocation size
-
PersistHeap buffer overflow via out-of-bounds array write
-
ImpactAchieve arbitrary code execution or memory corruption impact
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Heap buffer bounds checking
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires all of the following: (1) the target system must be a 32-bit Linux build (armv7l or i686 - 64-bit systems are architecturally immune); (2) pam_usb must be installed and configured as an active PAM module; (3) the attacker must have high privileges sufficient to write to or inject content into the pam_usb configuration file, as confirmed by CVSS PR:H - unauthenticated or low-privilege exploitation is not possible per the CVSS vector; (4) pam_usb authentication must be triggered (e.g., a login attempt) after the malicious configuration is in place to cause config parsing. Exploitation is limited by: the 32-bit architecture requirement (excludes the majority of modern server and desktop deployments), the high-privilege prerequisite (PR:H per CVSS vector), and local-only attack vector (AV:L - no remote exploitation path). |
| Impact | The CVSS 3.1 vector AV:L/AC:L/PR:H/UI:N/S:U yields a score of 6.7 (Medium), reflecting that exploitation requires both local system access and high privileges - the attacker must already be able to write or influence the pam_usb configuration file, which is typically root-owned. While the impact triad (C:H/I:H/A:H) signals complete host compromise upon successful exploitation, the PR:H prerequisite dramatically limits the realistic attacker population: an entity already possessing root-level write access to /etc/pam_usb.conf has likely already achieved their objective. The constraint to 32-bit architectures (armv7l, i686) further narrows exposure to embedded Linux deployments, older IoT hardware, or deliberately 32-bit build environments. No EPSS score was provided in the input data, so probabilistic exploitation likelihood cannot be quantified. This vulnerability is not listed in the CISA KEV catalog and no POC has been reported, consistent with its niche exploitation prerequisites. Practically, this is a low-priority finding for most deployments unless pam_usb is running on 32-bit systems where the configuration file is writable by partially-trusted processes or multi-tenant admin accounts below root. |
| Exploit ScenarioDerived | A local attacker who has obtained high-privilege access (e.g., root or a process with write access to /etc/pam_usb.conf) on a 32-bit Linux system (armv7l or i686) modifies the configuration file to declare an extremely large number of USB devices. When pam_usb next evaluates the config via libxml2 XPath, n_devices * sizeof(t_pusb_device) overflows the 32-bit size_t, causing xmalloc() to allocate a tiny heap buffer; subsequent device array population then writes far beyond the allocation boundary, corrupting adjacent heap structures. No public POC has been identified at time of analysis, but the overflow mechanics are straightforward for any analyst familiar with 32-bit integer arithmetic and heap exploitation on Linux. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 27, 2026
Heap buffer overflow in pam_usb prior to 0.9.1 allows a local attacker with high privileges to corrupt heap memory on 32-bit Linux platforms (armv7l, i686) by supplying a crafted configuration file with an excessive device count. The root cause is an unchecked integer multiplication in src/conf.c where n_devices * sizeof(t_pusb_device) wraps around size_t on 32-bit targets, causing xmalloc() to receive a drastically undersized allocation that is silently accepted, enabling out-of-bounds writes into heap memory. No public exploit code has been identified at time of analysis, and this vulnerability is not listed in the CISA KEV catalog; however, successful exploitation yields full confidentiality, integrity, and availability impact on the affected host.
RemediationAI
Upgrade pam_usb to version 0.9.1, which is the vendor-confirmed patched release per the GitHub security advisory at https://github.com/mcdope/pam_usb/security/advisories/GHSA-24mw-m2vf-36vp. This fix is expected to introduce an upper-bound check on n_devices before the heap allocation multiplication in src/conf.c, preventing the integer wrap-around. For environments that cannot immediately upgrade, the most effective compensating control is to ensure the pam_usb configuration file (typically /etc/pam_usb.conf) is writable only by root (mode 0600 or 0640, owned by root:root), which prevents any non-root actor from supplying a malicious device count - trade-off is negligible since this is the expected secure default. Additionally, consider restricting pam_usb deployment exclusively to 64-bit architectures where the size_t overflow condition cannot be triggered, eliminating the vulnerability entirely without a code change. Disabling pam_usb on 32-bit hosts until patched is the most conservative option if the authentication mechanism is not operationally critical.
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 PAM module that authenticates users via removable USB media, reading its configuration from an XML file parsed using libxml2 XPath queries. The vulnerable code resides in src/conf.c, where the integer n_devices - derived from the XPath-evaluated count of device entries in the config - is multiplied by sizeof(t_pusb_device) to compute a heap allocation size. On 32-bit architectures (armv7l and i686, both explicitly listed in the project Makefile), the type size_t is 32 bits wide, meaning sufficiently large n_devices values cause the multiplication result to wrap around to a small integer. xmalloc() calls abort() only on NULL return; a small-but-valid pointer is returned and accepted without error. Subsequent array writes then overflow the undersized heap buffer. This is a classic CWE-122 (Heap-based Buffer Overflow) triggered by an integer overflow precondition (related to CWE-190), and is exclusively reproducible on 32-bit targets due to the size_t width constraint. The CPE cpe:2.3:a:mcdope:pam_usb:*:*:*:*:*:*:*:* indicates all releases prior to the fix are affected.
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:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Primary rating from Vendor (GitHub_M) · only source for this CVE.
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
pam_usb provides hardware authentication for Linux using ordinary removable media. Prior to 0.9.1, src/conf.c allocates heap memory proportional to n_devices, a count derived from libxml2 XPath evaluation of the config file, without first enforcing an upper bound. On 32-bit targets (armv7l, i686 -- both listed in the project Makefile), the multiplication n_devices * sizeof(t_pusb_device) wraps around size_t, causing xmalloc() to receive a very small size. Because xmalloc() only calls abort() on NULL return, a small-but-non-NULL allocation is accepted, and subsequent array writes overflow the heap. This vulnerability is fixed in 0.9.1.
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
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
A heap overflow occurs when a program writes data beyond the bounds of a buffer allocated in the heap memory region.
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
XPath injection in pam_usb prior to 0.9.0 allows unauthenticated remote attackers to manipulate device-verification quer
Environment variable injection in pam_usb prior to version 0.9.2 allows a local authenticated user to bypass hardware US
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-32649
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB