# CVE-2026-21895: rsa crate has potential panic on a prime being equal to 1

> An attacker can cause a denial of service by providing a prime value of 1 during RSA private key construction, triggering a panic.

- **Severity:** Low 2.7 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 8 Jan 2026
- **Updated:** 8 Jan 2026
- **Also known as:** DEBIAN-CVE-2026-21895, GHSA-9c48-w39g-hm26, MINI-6hrw-2hmh-mc9r, MINI-xhmg-5q96-8j6v, UBUNTU-CVE-2026-21895, openSUSE-SU-2026:10105-1

## What is CVE-2026-21895?

CVE-2026-21895 is a low-severity denial of service vulnerability in RustCrypto RSA, published on 8 Jan 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The `rsa` crate is an RSA implementation written in rust. Prior to version 0.9.10, when creating a RSA private key from its components, the construction panics instead of returning an error when one of the primes is `1`. Version 0.9.10 fixes the issue.

Weakness: CWE-703 (Improper Check or Handling of Exceptional Conditions)

## Which versions are affected by CVE-2026-21895?

2 open source packages ship an affected version, including rsa. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `rsa` | crates.io | All versions | 0.9.10 |
| `rsa` | crates.io | All versions | 0.9.10 |
| `teleport` | openSUSE:Tumbleweed | All versions | 17.7.14-1.1 |

Products: Rustcrypto Rsa.

## How do I fix CVE-2026-21895?

Upgrade rsa to 0.9.10 or later.

## Is CVE-2026-21895 being exploited?

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

## Other vulnerabilities in RustCrypto RSA

- [CVE-2023-49092](https://insights.sbomify.com/CVE-2023-49092/): RustCrypto/RSA vulnerable to a Marvin Attack via key recovery through timing sidechannels (medium 5.9)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-21895 and fix it if it is affected.

What it is: CVE-2026-21895 is a low-severity denial of service vulnerability in RustCrypto RSA, published on 8 Jan 2026. 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-2026-21895 in the wild and no public exploit code.

Affected packages and fixed versions:
- rsa (crates.io): affected all versions; fixed in 0.9.10
- rsa (crates.io): affected all versions; fixed in 0.9.10

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-2026-21895/ (Markdown: https://insights.sbomify.com/CVE-2026-21895/index.md)
```

## Sources

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

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