# CVE-2025-24032: PAM-PKCS#11 vulnerable to authentication bypass with default value for `cert_policy` (`none`)

> Attackers can bypass authentication in PAM-PKCS#11 by creating a token with the user's public certificate, allowing unauthorized login as the victim.

- **Severity:** Critical 9.2 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:L/SC:L/SI:L/SA:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 10 Feb 2025
- **Updated:** 21 May 2025
- **Also known as:** DEBIAN-CVE-2025-24032, DLA-4058-1, GHSA-8r8p-7mgp-vf56, UBUNTU-CVE-2025-24032

## What is CVE-2025-24032?

CVE-2025-24032 is a critical authentication bypass vulnerability in OpenSC pam_pkcs11, published on 10 Feb 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

PAM-PKCS#11 is a Linux-PAM login module that allows a X.509 certificate based user login. Prior to version 0.6.13, if cert_policy is set to none (the default value), then pam_pkcs11 will only check if the user is capable of logging into the token. An attacker may create a different token with the user's public data (e.g. the user's certificate) and a PIN known to the attacker. If no signature with the private key is required, then the attacker may now login as user with that created token. The default to *not* check the private key's signature has been changed with commit commi6638576892b59a99389043c90a1e7dd4d783b921, so that all versions starting with pam_pkcs11-0.6.0 should be affected. As a workaround, in `pam_pkcs11.conf`, set at least `cert_policy = signature;`.

Weakness: CWE-287 (Improper Authentication)

## Which versions are affected by CVE-2025-24032?


## How do I fix CVE-2025-24032?

Upgrade to a fixed version.

## Is CVE-2025-24032 being exploited?

There is no known exploitation of CVE-2025-24032 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-24032 and fix it if it is affected.

What it is: CVE-2025-24032 is a critical authentication bypass vulnerability in OpenSC pam_pkcs11, published on 10 Feb 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-24032 in the wild and no public exploit code.

Affected product: OpenSC pam_pkcs11. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-24032/ (Markdown: https://insights.sbomify.com/CVE-2025-24032/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-24032
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-24032
- OSV: https://osv.dev/vulnerability/CVE-2025-24032

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-24032/
Summaries are generated and may contain mistakes; the official description above is the record.
