RUSTSEC-2026-0583: Panics during RSA private-key construction, validation, or re-encoding

Published Nov 19, 2026
·
Updated

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

- RsaPrivateKey::fromcomponents and PKCS#1 or PKCS#8 private-key decoding (DER or PEM) can panic during validation when a supplied factor equals 1, because RsaPrivateKey::validate() let a factor of 1 reach a later check that panicked. - RsaPrivateKey::fromprimes and RsaPrivateKey::frompq can panic during construction when a supplied factor is 0, 1, or even. - Prime recovery in RsaPrivateKey::fromcomponents can panic when the private exponent is 0. - For a key, including a valid one, whose first prime occupies more limbs than the second, crtcoefficient, topkcs1der, topkcs8der, and serde serialization can panic.

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 catchunwind around the entire operation when panics unwind.

Affected Software

1 affected componentFixes available
rust/sad-rsa>=0.0.0-0<0.10.4
0.10.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rust/sad-rsa to a version that resolves this vulnerability.

    Fixed in 0.10.4
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 0.10.4
  3. Compensating control

    If you cannot upgrade, isolate the entire private-key import, construction, validation, CRT calculation, or serialization operation in a separate process and treat abnormal exit as failure. When panics unwind, wrap the entire operation in catch_unwind; when built with panic = "abort", isolate it in a worker or separate process.

Event History

Nov 19, 2026
Advisory Published
via OSV·12:00 PM
Data Sourced
via OSV·12:00 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

Which applications are realistically exposed to this issue?

Applications are exposed if they import untrusted RSA private keys or factors through the affected construction or PKCS#1/PKCS#8 decoding paths, or if they re-encode a key whose first prime occupies more limbs than its second. Public-key parsing is not affected.

2

What input conditions can trigger a panic?

Construction or validation can panic with factors equal to 1, while from_primes and from_p_q can panic for factors that are 0, 1, or even. Prime recovery can panic if the private exponent is 0, and CRT-coefficient calculation or serialization can panic when the first prime has more limbs than the second, including for otherwise valid keys.

3

What is the operational impact of successful exploitation?

A panic can cause an application to lose a worker. Builds configured with panic = "abort" can terminate the entire process.

4

What version addresses the issue, and what does it change?

Version 0.10.4 fixes the issue. It rejects factors below 2, even factors, repeated factors, and a zero private exponent during prime recovery, and corrects CRT-coefficient computation and re-encoding for valid two-prime keys.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203