{"id":"CVE-2026-69247","aliases":["CVE-2026-69247","GHSA-g6cj-pr64-35w5","PYSEC-2026-3552"],"related":[],"kind":"vulnerability","state":"published","title":"cryptography: PKCS#7 EnvelopedData decryption exposes a Bleichenbacher oracle through distinguishable errors and timing","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\n`pkcs7_decrypt_der`, `pkcs7_decrypt_pem`, and `pkcs7_decrypt_smime` reported the\noutcome of decrypting a `RecipientInfo`'s `encryptedKey` in several\ndistinguishable ways, one of which disclosed the exact length recovered from the\nRSA operation. The same distinction was also observable by timing. An\napplication that decrypts attacker-supplied `EnvelopedData` and reflects the\noutcome gives the attacker a Bleichenbacher oracle against the\ncontent-encryption key.\n\nIntroduced in 44.0.0. Fixed in 50.0.0.\n\n### Details\n\nDecryption ran as: RSA PKCS#1 v1.5 decrypt of `encryptedKey` → build an AES\ncipher from the result → AES-CBC decrypt and PKCS#7 unpad. Each stage failed\ndifferently, with no RFC 3218 mitigation:\n\n1. invalid RSA padding → `Decryption failed`\n2. valid padding, bad key length → `Invalid key size (N) for AES.`, disclosing `N`\n3. correct length, wrong key → `Invalid padding bytes.`\n4. the real key → plaintext\n\nCase 1 is reachable only where the linked library lacks implicit rejection:\nOpenSSL 3.0 and 3.1, LibreSSL, and BoringSSL. On OpenSSL 3.2+, used in our wheels,\ninvalid padding instead returns a synthetic plaintext of\npseudorandom length, so the error channel does not distinguish conforming\nciphertexts.\n\nExploitation requires a service that auto-decrypts untrusted `EnvelopedData`\nmatching the victim certificate and answers adaptively at high volume, such as\nan S/MIME gateway or mail filter.\n\n### Fix\n\nPer RFC 3218, the content-encryption algorithm is now resolved before the\nprivate key is used, so the expected key length is known in advance. If the RSA\ndecryption fails or recovers a key of the wrong length, a random key of the\nexpected length is substituted and decryption continues down an identical path.\nAll failures now report identically and perform the same work.\n\n### Not addressed by this fix\n\n`EnvelopedData` does not authenticate its content. Tampering with\n`encryptedContent` alone yields a CBC padding oracle that recovers plaintext at\nroughly 256 queries per byte, without recovering any key, on every backend. This\nis a property of PKCS#7 rather than of this implementation, cannot be fixed in\nthe library, and is now documented.\n\n### Credit\n\nReported by @X1AOxiang.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Criptografía es un paquete diseñado para exponer primitivas criptográficas y recetas a desarrolladores de Python. Desde la versión 44.0.0 hasta la 50.0.0, pkcs7_decrypt_der, pkcs7_decrypt_pem y pkcs7_decrypt_smime informaron el resultado del descifrado de la encryptedKey de un RecipientInfo de varias maneras distinguibles, una de las cuales reveló la longitud exacta recuperada de la operación RSA. La misma distinción también era observable por temporización. Una aplicación que descifra EnvelopedData suministrada por el atacante y refleja el resultado le da al atacante un oráculo de Bleichenbacher contra la clave de cifrado de contenido. El descifrado se ejecutó como descifrado RSA PKCS#1 v1.5 de encryptedKey, se construyó un cifrador AES a partir del resultado, luego descifrado AES-CBC y desacolchado PKCS#7. El relleno RSA inválido, un relleno válido con una longitud de clave incorrecta, una longitud correcta con una clave errónea y la clave real, cada uno falló o tuvo éxito de manera diferente. El Caso 1 es alcanzable solo donde la biblioteca enlazada carece de rechazo implícito: OpenSSL 3.0 y 3.1, LibreSSL y BoringSSL. La explotación requiere un servicio que descifra automáticamente EnvelopedData no confiable que coincida con el certificado de la víctima y responde de forma adaptativa a gran volumen, como una pasarela S/MIME o un filtro de correo. Este problema está solucionado en la versión 50.0.0.","source":"nvd"}],"published":"2026-08-03T21:16:32.047Z","modified":"2026-10-23T21:10:00.157Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","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","score":8.2,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","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","score":8.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","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","rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","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"}],"cwes":["CWE-208","CWE-209"],"affected":[{"ranges":[{"version":">= 44.0.0, < 50.0.0","status":"affected"}],"vendor":"pyca","product":"cryptography","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"44.0.0","status":"affected","fixed":"50.0.0"}],"ecosystem":"PyPI","package":"cryptography","purl":"pkg:pypi/cryptography","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"44.0.0","status":"affected","fixed":"50.0.0"}],"ecosystem":"PyPI","package":"cryptography","purl":"pkg:pypi/cryptography","source":"pysec"}],"references":[{"url":"https://github.com/pyca/cryptography/security/advisories/GHSA-g6cj-pr64-35w5","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pyca/cryptography/pull/15369","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pyca/cryptography/commit/53fccd93413a8d7f07d6d8999681f27b75cffa3f","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pyca/cryptography","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/cryptography","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-g6cj-pr64-35w5","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-69247","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-08-04T14:09:18.204Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-69247","url":"https://www.cve.org/CVERecord?id=CVE-2026-69247","licence":"CVE Terms of Use","modified":"2026-08-04T14:09:24.615Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-g6cj-pr64-35w5","url":"https://github.com/advisories/GHSA-g6cj-pr64-35w5","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:53.610Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-69247","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-69247","licence":"Public domain","modified":"2026-10-23T21:10:00.157Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3552","url":"https://osv.dev/vulnerability/PYSEC-2026-3552","licence":"CC-BY-4.0","modified":"2026-08-04T14:30:15.036Z"}],"updatedAt":"2026-11-25T22:59:30.915Z","epss":{"score":0.00213,"percentile":0.1235,"date":"2026-12-01T12:00:22.000Z"}}