CVE-2026-21895: Rsa Rsa Crate Has Potential Panic Vulnerability

LOW
Advisory Identifier: GHSA-9c48-w39g-hm26
CWE-703
Published
Advisory Summary

CVE-2026-21895 is a LOW rsa crate has potential panic vulnerability (CWE-703: Improper Check or Handling of Exceptional Conditions) affecting Rsa libraries in the crates.io ecosystem. The issue involves rsa crate has potential panic on a prime being equal to 1. Remediation is available by upgrading affected packages to version 0.9.10.

CVE-2026-21895 at a Glance

CVE Identifier CVE-2026-21895
GHSA Identifier GHSA-9c48-w39g-hm26
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-703: Improper Check or Handling of Exceptional Conditions
Affected Product Rsa
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix CVE-2026-21895

To remediate this vulnerability, upgrade all affected Rsa dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

rsa fixed: 0.9.10
Upgrade rsa to 0.9.10
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for rsa

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-21895, inspect your project dependencies for Rsa:

inspect dependencies for rsa

Analyze the terminal output to locate any version of Rsa in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.9.10), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-703: Improper Check or Handling of Exceptional Conditions, where the product does not properly anticipate or handle exceptional conditions that rarely occur during normal operation of the product. In Rsa, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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](https://www.radicallyopensecurity.com/) during a security review for [Proton AG](https://proton.me/).

CVE-2026-21895 Affected Rsa Versions

1 component(s)
Fixed Versions:
0.9.10
Product / Package Ecosystem Affected Versions Fixed Version
rsa
crates.io
< 0.9.10
0.9.10

References

Frequently Asked Questions

What is CVE-2026-21895?
CVE-2026-21895 is a security vulnerability in Rsa involving rsa crate has potential panic on a prime being equal to 1 under CWE-703: Improper Check or Handling of Exceptional Conditions.
Which Rsa versions are affected?
Affected versions include releases prior to 0.9.10 across affected packages: rsa.
What version fixes CVE-2026-21895?
Upgrading to 0.9.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rsa affected?
Yes, rsa is affected in releases prior to 0.9.10. Upgrade your dependency to 0.9.10 or later.
What CWE is associated with CVE-2026-21895?
CVE-2026-21895 is classified under CWE-703: Improper Check or Handling of Exceptional Conditions (The product does not properly anticipate or handle exceptional conditions that rarely occur during normal operation of the product.).
How can I check crates.io dependencies for CVE-2026-21895?
Run the dependency tree command: 'inspect dependencies for rsa'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9c48-w39g-hm26",
  "modified" : "2026-01-08T21:18:57Z",
  "published" : "2026-01-06T18:14:08Z",
  "aliases" : [ "CVE-2026-21895" ],
  "summary" : "rsa crate has potential panic on a prime being equal to 1",
  "details" : "When creating a RSA private key from its components, the construction panics, instead of returning an error, when one of the primes is `1`. \n\nDiscovered by Christian Reitter from [Radically Open Security](https://www.radicallyopensecurity.com/) during a security review for [Proton AG](https://proton.me/).",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "rsa"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.9.10"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.9.9"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/RustCrypto/RSA/security/advisories/GHSA-9c48-w39g-hm26"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-21895"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/RustCrypto/RSA/commit/2926c91bef7cb14a7ccd42220a698cf4b1b692f7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/RustCrypto/RSA"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-703" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-06T18:14:08Z",
    "nvd_published_at" : "2026-01-08T14:15:57Z"
  }
}