Description
cryptography is a package designed to expose cryptographic primitives and recipes to Python developers. From 44.0.0 until 50.0.0, pkcs7_decrypt_der, pkcs7_decrypt_pem, and pkcs7_decrypt_smime 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.
Published: 2026-08-03
Score: 8.2 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability lies in the PKCS#7 EnvelopedData decryption routine of the cryptography library, where decrypting a RecipientInfo's encryptedKey can produce distinct error messages and timing differences that reveal the exact length restored from the RSA operation. This behavior allows an attacker to construct a Bleichenbacher oracle, enabling decryption of the wrapped encryption key when the ciphertext is supplied to the vulnerable application. The weakness is an information disclosure that can be leveraged to recover the sought content‑encryption key, potentially exposing all data protected by that key.

Affected Systems

The issue affects the pyca:cryptography library in versions 44.0.0 through 49.x.x, inclusive. Applications that depend on these releases and resort to raw cryptography.pkcs7_decrypt_der, pkcs7_decrypt_pem, or pkcs7_decrypt_smime functions are vulnerable if they process user‑supplied EnvelopedData. Critical exposure occurs if the linked OpenSSL, LibreSSL, or BoringSSL dispatches do not reject invalid padding implicitly, which is the case in OpenSSL 3.0, 3.1, LibreSSL, and BoringSSL.

Risk and Exploitability

The CVSS score of 8.2 indicates a high severity exploitation scenario. An attacker requires a service that automatically decrypts untrusted S/MIME or PDF envelopes that match the victim’s certificate and can respond in real time to distinguishable failures. With no current EPSS data or KEV listing, adoption of the fix is still critical for any production environment processing potentially malicious enveloped messages, as the exploit is realistically feasible against such services.

Generated by OpenCVE AI on August 4, 2026 at 09:41 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the cryptography library to version 50.0.0 or later, which removes the distinguishable error paths and timing side‑channels in the PKCS#7 decryption flow.
  • If upgrading immediately is not possible, disable automatic decryption of untrusted EnvelopedData, or enforce strict certificate validation so that only data signed by a trusted source is processed.
  • Implement rate‑limiting or request throttling on any decryption endpoints to mitigate high‑volume oracle exploitation attempts.

Generated by OpenCVE AI on August 4, 2026 at 09:41 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-g6cj-pr64-35w5 cryptography: PKCS#7 EnvelopedData decryption exposes a Bleichenbacher oracle through distinguishable errors and timing
History

Tue, 04 Aug 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Mon, 03 Aug 2026 22:45:00 +0000

Type Values Removed Values Added
First Time appeared Pyca
Pyca cryptography
Vendors & Products Pyca
Pyca cryptography

Mon, 03 Aug 2026 21:45:00 +0000

Type Values Removed Values Added
Description cryptography is a package designed to expose cryptographic primitives and recipes to Python developers. From 44.0.0 until 50.0.0, pkcs7_decrypt_der, pkcs7_decrypt_pem, and pkcs7_decrypt_smime 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.
Title cryptography: PKCS#7 EnvelopedData decryption exposes a Bleichenbacher oracle through distinguishable errors and timing
Weaknesses CWE-208
CWE-209
References
Metrics cvssV4_0

{'score': 8.2, 'vector': 'CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N'}


Subscriptions

Pyca Cryptography
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-04T14:09:24.615Z

Reserved: 2026-08-03T19:54:19.852Z

Link: CVE-2026-69247

cve-icon Vulnrichment

Updated: 2026-08-04T14:09:21.845Z

cve-icon NVD

Status : Received

Published: 2026-08-03T22:16:52.380

Modified: 2026-08-04T15:16:43.393

Link: CVE-2026-69247

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-04T09:45:03Z

Weaknesses
  • CWE-208

    Observable Timing Discrepancy

  • CWE-209

    Generation of Error Message Containing Sensitive Information