REDHAT-BUG-2510835: Medium severity pypi/cryptography vulnerability

Published Aug 3, 2026
·
Updated

cryptography is a package designed to expose cryptographic primitives and recipes to Python developers. From 44.0.0 until 50.0.0, pkcs7decryptder, pkcs7decryptpem, and pkcs7decryptsmime reported the outcome of decrypting a RecipientInfo's encryptedKey in several distinguishable ways, one of which disclosed the exact length recovered from the RSA operation. The same distinction was also observable by timing. An application that decrypts attacker-supplied EnvelopedData and reflects the outcome gives the attacker a Bleichenbacher oracle against the content-encryption key. Decryption ran as RSA PKCS#1 v1.5 decrypt of encryptedKey, build an AES cipher from the result, then AES-CBC decrypt and PKCS#7 unpad. Invalid RSA padding, a valid padding with a bad key length, a correct length with a wrong key, and the real key each failed or succeeded differently. Case 1 is reachable only where the linked library lacks implicit rejection: OpenSSL 3.0 and 3.1, LibreSSL, and BoringSSL. Exploitation requires a service that auto-decrypts untrusted EnvelopedData matching the victim certificate and answers adaptively at high volume, such as an S/MIME gateway or mail filter. This issue is fixed in 50.0.0.

Affected Software

1 affected component
pypi/cryptography>=44.0.0<50.0.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade cryptography to a version that resolves this vulnerability.

    Fixed in 50.0.0

Event History

Aug 3, 2026
Data Sourced
via Red Hat·10:03 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

Which deployments are realistically exposed to exploitation?

Exposure requires a service that automatically decrypts attacker-supplied EnvelopedData for the victim certificate and returns distinguishable results to the sender. Examples given are S/MIME gateways and mail filters; the attacker must be able to make adaptive, high-volume requests.

2

Does the linked cryptographic library affect reachability?

Yes. The invalid-RSA-padding case is reachable only when the linked library lacks implicit rejection, specifically OpenSSL 3.0 or 3.1, LibreSSL, or BoringSSL.

3

What observable behavior creates the oracle?

The decryption functions distinguish invalid RSA padding, a valid padding with an invalid key length, a correct-length but incorrect key, and successful decryption. These outcomes can be distinguished through returned results and timing when the application reflects them.

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