CVE-2020-25659:Timing Attack Vulnerability in python-cryptography 3.2 RSA Decryption API

splash
Back

Description Preview

Python-cryptography 3.2 contains a vulnerability to Bleichenbacher timing attacks in its RSA decryption API. The issue occurs when processing valid PKCS#1 v1.5 ciphertext, where timing differences in the processing can potentially leak information about the private key. This vulnerability could allow an attacker to recover the private key through careful timing analysis of multiple decryption operations.

Overview

This vulnerability (CVE-2020-25659) affects the python-cryptography library version 3.2. The issue is related to the RSA decryption implementation that processes PKCS#1 v1.5 padding. Bleichenbacher timing attacks exploit the fact that valid and invalid ciphertexts may take different amounts of time to process, creating a side-channel that can be used to gradually extract information about the private key. This type of attack is particularly concerning for applications that use RSA encryption for sensitive operations, as it can lead to complete key compromise without direct access to the system.

Remediation

To address this vulnerability, users should:

  1. Update to a patched version of python-cryptography (versions after 3.2).
  2. If immediate updating is not possible, consider implementing additional countermeasures such as:
    • Adding random delays to cryptographic operations to mask timing differences
    • Using constant-time implementations for cryptographic operations where available
    • Limiting the number of decryption operations that can be performed with the same key
  3. Review applications that use RSA decryption to ensure they're not vulnerable to timing analysis.
  4. Consider migrating to more modern padding schemes like OAEP (Optimal Asymmetric Encryption Padding) which are designed to be resistant to these types of attacks.

References

  1. Patch commit: https://github.com/pyca/cryptography/pull/5507/commits/ce1bef6f1ee06ac497ca0c837fbd1c7ef6c2472b
  2. Oracle Critical Patch Update Advisory - April 2022: https://www.oracle.com/security-alerts/cpuapr2022.html
  3. Oracle Critical Patch Update Advisory - July 2022: https://www.oracle.com/security-alerts/cpujul2022.html
  4. For more information on Bleichenbacher attacks: "Chosen Ciphertext Attacks Against Protocols Based on the RSA Encryption Standard PKCS #1" by Daniel Bleichenbacher

Industry ExposureMost to least
This section illustrates the prevalence of a specific Common Vulnerabilities and Exposures (CVE) across various industries based on customer reports. The ranking displays industries from the most to least affected by this particular vulnerability, offering valuable insight into where this CVE has been most frequently observed. This information can help organizations within these sectors prioritize their security efforts, understand their relative risk exposure compared to their peers, and focus remediation strategies where they are most needed. By understanding the industry-specific impact, organizations can make more informed decisions regarding patching, resource allocation, and overall risk management related to this CVE.

  1. Manufacturing
    Manufacturing
  2. Finance and Insurance
    Finance and Insurance
  3. Professional, Scientific, & Technical Services
    Professional, Scientific, & Technical Services
  4. Health Care & Social Assistance
    Health Care & Social Assistance
  5. Retail Trade
    Retail Trade
  6. Public Administration
    Public Administration
  7. Arts, Entertainment & Recreation
    Arts, Entertainment & Recreation
  8. Management of Companies & Enterprises
    Management of Companies & Enterprises
  9. Transportation & Warehousing
    Transportation & Warehousing
  10. Educational Services
    Educational Services
  11. Information
    Information
  12. Other Services (except Public Administration)
    Other Services (except Public Administration)
  13. Utilities
    Utilities
  14. Wholesale Trade
    Wholesale Trade
  15. Accommodation & Food Services
    Accommodation & Food Services
  16. Administrative, Support, Waste Management & Remediation Services
    Administrative, Support, Waste Management & Remediation Services
  17. Agriculture, Forestry Fishing & Hunting
    Agriculture, Forestry Fishing & Hunting
  18. Construction
    Construction
  19. Mining
    Mining
  20. Real Estate Rental & Leasing
    Real Estate Rental & Leasing

Focus on What Matters

  1. See Everything.
  2. Identify True Risk.
  3. Proactively Mitigate Threats.

Let's talk!

background