# CVE-2026-47271: pam_usb: OOM guards removed by -DNDEBUG cause NULL dereference and authentication process crash

- Severity: Medium 5.1 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.12%, higher than 2% of CVEs (2026-12-02)
- Published: 2026-05-27T20:08:02.552Z
- Modified: 2026-10-26T11:10:00.157Z
- Weaknesses: CWE-476
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

pam_usb provides hardware authentication for Linux using ordinary removable media. Prior to 0.9.0, src/mem.c implemented out-of-memory guards for xmalloc(), xrealloc(), and xstrdup() using assert(data != NULL). The C standard specifies that all assert() expressions are compiled out when NDEBUG is defined at build time. NDEBUG is commonly defined in release and packaging builds (Debian, Fedora, Arch package flags all define it via -DNDEBUG in CFLAGS). With the guard removed, xmalloc/xrealloc/xstrdup silently return NULL on allocation failure. Every caller in the codebase dereferences the return value without a NULL check -- this is the intended design, as the guard was supposed to abort before the dereference. With the guard gone, any allocation failure causes a NULL pointer dereference, crashing the PAM module. A crash in a PAM module loaded by sudo or login causes authentication to fail for the duration of the crash, creating a local denial-of-service condition. An attacker who can induce memory pressure at authentication time can lock all users out of sudo and login. This vulnerability is fixed in 0.9.0.

(As written by CVE List.)

## Affected

- mcdope pam_usb: < 0.9.0

## References

- <https://github.com/mcdope/pam_usb/security/advisories/GHSA-7rvx-jcc6-7hqq>
- <https://github.com/mcdope/pam_usb/commit/d003e551b794a9e3774ff4720830fb7aadaa48bd>

## Sources

- CVE List: [CVE-2026-47271](https://www.cve.org/CVERecord?id=CVE-2026-47271), CVE Terms of Use, modified 2026-05-28
- NVD: [CVE-2026-47271](https://nvd.nist.gov/vuln/detail/CVE-2026-47271), Public domain, modified 2026-10-26

---

Page: https://cve.day/CVE-2026-47271 · Whole record: https://cve.day/CVE-2026-47271.json · Rebuilt by cve.day 2026-11-25T22:59:22.673Z
