CVE-2026-21895: rsa crate has potential panic on a prime being equal to 1
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.
Other sources
When creating a RSA private key from its components, the construction panics, instead of returning an error, when one of the primes is 1.
Discovered by Christian Reitter from Radically Open Security during a security review for Proton AG.
— GitHub
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2026-21895?
CVE-2026-21895 has been classified as a moderate severity vulnerability due to the potential for panic during RSA key generation.
How do I fix CVE-2026-21895?
To fix CVE-2026-21895, upgrade to version 0.9.10 of the 'rsa' package in Rust.
What software is affected by CVE-2026-21895?
CVE-2026-21895 affects versions of the 'rsa' package from Rust up to and including 0.9.9.
What happens if I use a prime of '1' with CVE-2026-21895?
Using a prime of '1' in RSA key generation with CVE-2026-21895 will result in a panic instead of an error.
Who discovered CVE-2026-21895?
CVE-2026-21895 was discovered by Christian Reitter from Radically Open Security during a security review for Proton AG.