psf-pam-mysql-check(8)
Overview
pam-mysql inverted empty-password check, November 2026: check and hunt (v1) CVE-2026-124749 (CVSS 8.1 to 9.8 depending on the setup; demonstrated, no public exploit)
pam-mysql checks Linux logins against a MySQL table. When a service asks PAM to refuse accounts with no password (PAM_DISALLOW_NULL_AUTHTOK, which sshd sets with its default PermitEmptyPasswords no), pam-mysql does the opposite: anyone can log in, typing any password, as an account whose stored password is NULL (0.8.x) or NULL or empty (the 1.0.0 betas). Every release is affected. Debian fixed it on 19 November 2026 (Debian 12: 0.8.2-2+deb12u1, DLA-4919-1; Debian 13: 0.8.2-2.1+deb13u1, DSA-6643-1), adding a nullok option that is off by default. Ubuntu, Fedora, Gentoo and Debian testing had no fix on 21 November. Do NOT set PermitEmptyPasswords yes as a fix: that opens a different hole.
Command reference
The original help text below includes the command syntax, options, environment variables and exit codes supplied with this tool. Review the source and test any change before applying it to a production system.
Original command-line help
pam-mysql inverted empty-password check, November 2026: check and hunt (v1)
CVE-2026-124749 (CVSS 8.1 to 9.8 depending on the setup; demonstrated, no public exploit)
If this software is helpful, consider a donation to our 501c3 nonprofit:
https://privacysafe.foundation
Help and documentation: https://privacysafe.app/docs/security-patches/system/pam-mysql/
pam-mysql checks Linux logins against a MySQL table. When a service asks PAM to refuse
accounts with no password (PAM_DISALLOW_NULL_AUTHTOK, which sshd sets with its default
PermitEmptyPasswords no), pam-mysql does the opposite: anyone can log in, typing any password,
as an account whose stored password is NULL (0.8.x) or NULL or empty (the 1.0.0 betas). Every
release is affected. Debian fixed it on 19 November 2026 (Debian 12: 0.8.2-2+deb12u1, DLA-4919-1;
Debian 13: 0.8.2-2.1+deb13u1, DSA-6643-1), adding a nullok option that is off by default.
Ubuntu, Fedora, Gentoo and Debian testing had no fix on 21 November. Do NOT set
PermitEmptyPasswords yes as a fix: that opens a different hole.
Usage:
./pam-mysql-check.sh [command]
check (default) Read-only. Finds the PAM services that use pam_mysql,
reads sshd's PermitEmptyPasswords, judges the installed
package, and reads the table and column pam-mysql checks
from its PAM arguments or config_file. With QUERY_DB=1 it
also asks the database how many rows have no password,
using pam-mysql's own read credentials (count only; add
LIST_USERS=1 to list the names). Exit 0 = not in use or
fixed, 1 = in use and not fixed, 2 = something could not
be read.
hunt Read-only. Lists "Accepted password" logins from the auth
log and the journal. With QUERY_DB=1, a login by an account
that has no stored password now is marked: that login was
a bypass (the table now may not show what it held then: a
backup or the binary log does). Exit 0 = nothing found,
1 = leads, 2 = no log could be read.
version Prints the script version.
Until a fixed package is installed: give every row in the login table a password or lock it,
then make the password column NOT NULL with no empty default (see the README).
Env overrides:
PAM_DIR=/etc/pam.d SSHD_CONFIG=/etc/ssh/sshd_config SSHD_T_OUTPUT (testing only)
QUERY_DB=0 1 asks the database (needs the mysql or mariadb client)
LIST_USERS=0 1 lists the names of rows with no password
HUNT_LOG_FILES instead of /var/log/auth.log* /var/log/secure*
PKG_VERSION, OS_RELEASE_FILE (testing only)The Security Patches software and this documentation are dedicated to the public domain under CC0 1.0 Universal. Other pages on privacysafe.app/docs are CC BY-SA 4.0 unless the page says otherwise.