Operating system and libraries
pam-mysql
pam-mysql: CVE-2026-124749, accounts with no password let in
pam-mysql inverted empty-password check
pam-mysql checks Linux logins against a MySQL or MariaDB table. When a service asks PAM to refuse accounts with no password, which sshd does with its default PermitEmptyPasswords no, pam-mysql does the opposite: anyone can log in over SSH, typing any password, as an account whose stored password is NULL (0.8.x) or NULL or empty (the 1.0.0 betas, so the common NOT NULL DEFAULT '' column is exposed; PostfixAdmin and Froxlor ship tables like that).
| CVE | CVE-2026-124749 |
|---|---|
| Severity | 8.1 to 9.8, depending on the setup |
| Affected | Every release (0.8.x and the 1.0.0 betas) when the module is in a login service's PAM stack and a row has no password |
| Fixed | Debian 12 0.8.2-2+deb12u1 (DLA-4919-1) and Debian 13 0.8.2-2.1+deb13u1 (DSA-6643-1), 19 November 2026, adding a nullok option that is off by default. Not fixed on 21 November: Debian testing and unstable, Ubuntu, Fedora (pam_mysql), Gentoo |
| Exploited | No; demonstrated by the researcher, exploit not published |
Do not set PermitEmptyPasswords yes as a fix. The researcher says that opens a different hole.
Quick start
-
Download the script. The repository is mirrored on GitHub and Codeberg; pick a base URL.
# BASE from GitHub: https://raw.githubusercontent.com/PrivacySafe/security-patches/refs/heads/main # BASE from Codeberg: https://codeberg.org/PrivacySafe/security-patches/raw/branch/main curl -fLO https://raw.githubusercontent.com/PrivacySafe/security-patches/refs/heads/main/system/pam-mysql/pam-mysql-check.sh -
Read it before running it, then make it executable.
less pam-mysql-check.sh chmod +x pam-mysql-check.sh -
Check. As root it can read sshd's effective settings and pam-mysql's configuration;
QUERY_DB=1also counts the rows with no password, with pam-mysql's own read credentials.sudo ./pam-mysql-check.sh check sudo QUERY_DB=1 ./pam-mysql-check.sh check -
Look for past logins by accounts with no stored password.
sudo QUERY_DB=1 ./pam-mysql-check.sh hunt
Commands
| Command | What it does |
|---|---|
check (default) |
The PAM services that load pam_mysql.so, sshd's PermitEmptyPasswords (from sshd -T as root), the installed package against Debian's fixed versions, and the table and columns pam-mysql checks (from its PAM arguments or config_file). With QUERY_DB=1: how many rows have a NULL or empty password (LIST_USERS=1 lists them). Read-only. Exits 0 if pam-mysql is not in use or is fixed, 1 if it is in use and not fixed, 2 if something could not be read |
hunt |
"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 as a bypass. Read-only. Exits 0 if nothing is found, 1 for leads, 2 if no log could be read |
version |
Prints the script version |
Until a fixed package exists
Give every row in the login table a password or lock it, then make the password column NOT NULL with no empty-string default, so a new row cannot reopen it. With your table and column names:
SELECT username FROM users WHERE password IS NULL OR password = '';
ALTER TABLE users MODIFY password VARCHAR(255) NOT NULL; -- after every row has a value
A bypass looks like any other password login in sshd's log ("Accepted password for"). The table as it is now may not show what it held at the time; a backup or the binary log does.
Before you run it
QUERY_DB=1reads pam-mysql's database credentials from its PAM line orconfig_fileand passes the password to the client through the environment, not the command line. It runs oneSELECT; it changes nothing.
Sources: Debian DSA-6643-1, Debian DLA-4919-1 and the oss-security report. Status current on 23 November 2026.
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.