Skip to content

NULL pointer dereference from UDisks device fields causes PAM crash and login denial-of-service

Moderate
mcdope published GHSA-j8cq-2gv6-gfwf May 7, 2026

Software

pam_usb

Affected versions

< 0.8.7

Patched versions

0.8.7

Description

Summary

src/device.c passed the return values of udisks_drive_get_serial(), udisks_drive_get_vendor(), and udisks_drive_get_model() directly to strcmp() without NULL checks:

retval = strcmp(udisks_drive_get_serial(drive),
                opts->device_list[currentDevice].serial) == 0;
retval = retval && strcmp(udisks_drive_get_vendor(drive), ...) == 0;
retval = retval && strcmp(udisks_drive_get_model(drive),  ...) == 0;

The GIO/UDisks API documentation states these accessors can return NULL for devices that do not expose the corresponding field. Passing NULL to strcmp() is undefined behaviour (typically a SIGSEGV).

Impact

An attacker with physical access can plug in a USB device (or mass-storage gadget) that exposes no serial number via UDisks. The PAM module crashes during device enumeration, causing authentication to fail for all users on the affected service until the device is removed. On a single-user workstation with only pam_usb configured for login this results in a complete lockout.

Affected versions

pam_usb <= 0.8.6

Fix

NULL checks added before all three strcmp() calls in pusb_device_check(). A NULL serial, vendor, or model causes the drive to be skipped (treated as non-matching) rather than crashing.

Fix committed in d9acb56 (src/device.c).

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Physical
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:P/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

CVE ID

CVE-2026-44710

Weaknesses

NULL Pointer Dereference

The product dereferences a pointer that it expects to be valid but is NULL. Learn more on MITRE.

Credits