
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2025-24531 is an authentication bypass vulnerability in OpenSC's pam_pkcs11 module (versions up to and including 0.6.12) where pam_sm_authenticate() incorrectly returns PAM_IGNORE in numerous error conditions — such as a smartcard triggering a crypto initialization failure — instead of returning a proper failure code. This regression was introduced in commit bac6cf8 in version 0.6.12 (released July 2021) and allows a local or physically present attacker to bypass authentication entirely in affected PAM stack configurations. The vulnerability was discovered by SUSE security engineers Matthias Gerstner and Marcus Rückert in October 2024, with coordinated disclosure completed and upstream fix released on February 6, 2025. It carries a CVSS v3.1 base score of 6.7 (Medium) per NVD, though the GitHub Security Advisory rates it 9.3 (Critical) under a broader scope assessment (GitHub Advisory, oss-security).
The root cause is classified as CWE-393 (Return of Wrong Status Code). In pam_pkcs11 version 0.6.12, commit bac6cf8 changed the default error return value in pam_sm_authenticate() from PAM_CRED_INSUFFICIENT to PAM_IGNORE when no login_token_name is set (i.e., during initial login). This affects a large number of error exit paths — including crypto_init() failure, PKCS#11 module load failure, missing smartcard, session open failure, certificate list retrieval failure, and many others. When PAM_IGNORE is returned by a required PAM module, the PAM library treats the module's result as non-decisive; if all remaining modules on the stack are non-authenticating utility modules (e.g., pam_shells, pam_env, pam_gnome_keyring) that return PAM_SUCCESS, the overall authentication result becomes PAM_SUCCESS — granting access without valid credentials. Only two code paths (pkcs11_login() failure and verify_signature() failure) correctly return PAM_AUTH_ERR (oss-security, GitHub Advisory).
Successful exploitation allows a local or physically present attacker to completely bypass smartcard-based authentication and gain unauthorized access to a Linux desktop or system session without providing any credentials. The primary attack scenario involves inserting an arbitrary or mismatched smartcard (or YubiKey) into a reader on a system using GDM with the gdm-smartcard PAM stack, causing pam_pkcs11 to fail and return PAM_IGNORE, after which utility modules supply a PAM_SUCCESS result. This results in full confidentiality and integrity compromise of the authenticated user's session, with no availability impact. Affected distributions include openSUSE Tumbleweed (confirmed exploitable), and potentially Arch Linux, Exherbo Linux, and Linux from Scratch if pam_pkcs11 is installed and configured as the sole authentication module (oss-security, GitHub Advisory).
No public exploit code or exploit kit has been identified for this vulnerability. The EPSS score is very low at 0.013%, and it is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. However, the vulnerability is practically exploitable by any physically present attacker on an affected system — simply inserting an arbitrary or invalid smartcard into a reader is sufficient to trigger the PAM_IGNORE return path and bypass authentication. No threat actor attribution has been reported. The vulnerability has been detected by Nessus (plugin 216206) and Qualys (IDs 6017635, 6021824) (oss-security, GitHub Advisory).
gdm-smartcard PAM stack uses pam_pkcs11 as the sole authenticating module with the required control setting.gdm-smartcard PAM stack is invoked, which calls pam_pkcs11.pam_pkcs11 to fail at an early stage (e.g., crypto_init() failure, PKCS#11 module initialization failure, or certificate mismatch), causing pam_sm_authenticate() to return PAM_IGNORE instead of an error code.PAM_IGNORE is returned by the required pam_pkcs11 module, the PAM library ignores its result. The remaining utility modules on the stack (e.g., pam_shells, pam_env, pam_gnome_keyring) return PAM_SUCCESS, making the overall authentication result PAM_SUCCESS. Login succeeds without any valid credential being provided (oss-security, GitHub Advisory)./var/log/auth.log or journalctl) showing a pam_pkcs11 log entry "Failed to initialize crypto" or similar PKCS#11 error immediately followed by a successful GDM login for a user.pam_pkcs11 returning without PAM_AUTH_ERR or PAM_CRED_INSUFFICIENT during a login session where no valid smartcard certificate was presented./var/log/gdm/) indicating a switch to smartcard authentication mode coinciding with an unexpected successful login.Patch: Upgrade pam_pkcs11 to version 0.6.13, released February 6, 2025, which restores the original card_only/wait_for_card behavior by changing erroneous PAM_IGNORE return values back to PAM_CRED_INSUFFICIENT (commit 2ecba68d40). Distribution-specific updates are available for Debian, Ubuntu (USN-7363-1), and openSUSE (pam_pkcs11 Releases, Ubuntu Advisory).
Workaround (if patching is not immediately possible): Replace the required control setting for pam_pkcs11 in the affected PAM stack (e.g., gdm-smartcard) with the following extended syntax:
auth [success=ok default=bad] pam_pkcs11.so wait_for_card card_onlyThis ensures that any return value other than PAM_SUCCESS — including PAM_IGNORE — is treated as a failure, preventing authentication bypass (oss-security).
The vulnerability was reported by SUSE security engineer Matthias Gerstner, who published a detailed technical blog post and oss-security disclosure on February 6, 2025. The linux-pam developer Dmitry V. Levin, consulted during the disclosure process, confirmed that the switch to PAM_IGNORE is problematic when end users are unaware of the behavioral change. The disclosure also highlighted a broader industry concern about PAM module authors misusing PAM_IGNORE in error paths, with a similar issue found in Yubico's pam_u2f module around the same time. Security news outlets including CyberSecurityNews and SecurityOnline.info covered the vulnerability, noting its potential to allow authentication bypass on Linux systems using X.509 certificate-based login (oss-security, GitHub Advisory).
Fix availability across major Linux distributions and their releases.
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."