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

Low 2.7 Published Updated

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

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

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

Which versions are affected by CVE-2026-21895?

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

PackageAffectedFixed in
rsa crates.ioAll versions0.9.10
rsa crates.ioAll versions0.9.10
Linux distribution packages (1)
teleport openSUSE:TumbleweedAll versions17.7.14-1.1

Products include Rustcrypto Rsa.

How do I fix CVE-2026-21895?

Upgrade rsa to 0.9.10 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2026-21895 being exploited?

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

Sources

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.

Is CVE-2026-21895 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free