RustSec logo

History ⋅ Edit ⋅ JSON (OSV)

RUSTSEC-2026-0583

Panics during RSA private-key construction, validation, or re-encoding

Reported
Issued
Package
sad-rsa (crates.io)
Type
Vulnerability
Categories
Keywords
#rsa #panic #private-key #pkcs1 #pkcs8
Aliases
References
CVSS Score
5.3 MEDIUM
CVSS Details
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality Impact
None
Integrity Impact
None
Availability Impact
Low
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Patched
  • >=0.10.4
Affected Functions
Version
sad_rsa::RsaPrivateKey::crt_coefficient
  • <0.10.4
sad_rsa::RsaPrivateKey::from_components
  • <0.10.4
sad_rsa::RsaPrivateKey::from_p_q
  • <0.10.4
sad_rsa::RsaPrivateKey::from_primes
  • <0.10.4
sad_rsa::RsaPrivateKey::validate
  • <0.10.4

Description

RsaPrivateKey private-key construction, validation, and serialization can panic across three classes of inputs, as well as when re-encoding certain valid keys:

An application that imports untrusted private keys or factors, or re-encodes such keys, can lose a worker, or the whole process when built with panic = "abort". Public-key parsing is not affected.

Fixed in 0.10.4, which rejects factors below 2, even factors, repeated factors, and a zero private exponent during prime recovery, and computes the CRT coefficient and re-encodes valid two-prime keys when the first prime occupies more limbs than the second.

If you cannot upgrade to 0.10.4, isolate the entire import, construction, CRT calculation, or serialization in a separate process and treat an abnormal exit as an operation failure, or use catch_unwind around the entire operation when panics unwind.

Advisory available under CC0-1.0 license.