Description
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.
Published: 2026-05-27
Score: 6.7 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability in pam_usb occurs when the module allocates memory for device structures without enforcing an upper bound on the number of devices parsed from an XML configuration. On 32‑bit systems, the multiplication of the device count by the size of the structure wraps around size_t, causing the allocator to receive a very small size. The allocation succeeds with a small non‑NULL buffer, and subsequent array writes overflow the heap. Because the module runs with elevated privileges during authentication, this overflow could allow an attacker to execute arbitrary code with root privileges, effectively yielding local privilege escalation (inferred from the described behavior).

Affected Systems

The affected product is pam_usb provided by mcdope. Versions prior to 0.9.1 are vulnerable; the bug manifests only on 32‑bit targets (armv7l and i686). The issue is absent in 0.9.1 and later releases and on 64‑bit architectures.

Risk and Exploitability

The CVSS score of 6.7 indicates a moderate severity. EPSS information is not available, and the vulnerability is not listed in the CISA KEV catalog, suggesting a lower exploitation probability compared to higher‑profile bugs. The likely attack vector is local: an attacker with the ability to supply a specially crafted XML configuration or a physical USB device with a manipulated device count could trigger the overflow (inferred from the need to modify the configuration file or input credentials during authentication). Formal exploitation would require the attacker to have sufficient permission to modify the configuration file or inject credentials during the authentication process. While not an obvious remote vector, the elevated privileges of the module make the potential damage significant.

Generated by OpenCVE AI on May 27, 2026 at 22:41 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update pam_usb to version 0.9.1 or later to eliminate the unchecked multiplication bug.
  • Ensure the pam_usb configuration file is owned by root and has read‑only permissions for non‑administrators to prevent unauthorized modifications that could introduce malicious device counts.
  • Configure the PAM service to restrict authentication to trusted users only, minimizing the attack surface for potential exploit attempts.

Generated by OpenCVE AI on May 27, 2026 at 22:41 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 27 May 2026 20:15:00 +0000

Type Values Removed Values Added
Description 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.
Title pam_usb: Unchecked integer multiplication before xmalloc() in conf.c allows heap-based buffer overflow on 32-bit targets
Weaknesses CWE-122
CWE-190
References
Metrics cvssV3_1

{'score': 6.7, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-05-27T19:58:36.447Z

Reserved: 2026-05-20T18:25:25.707Z

Link: CVE-2026-48065

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-05-27T20:16:40.380

Modified: 2026-05-27T20:16:40.380

Link: CVE-2026-48065

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-05-27T22:45:44Z

Weaknesses