Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2020-25659

CVE-2020-25659: Cryptography RSA Timing Attack Vulnerability

CVE-2020-25659 is a Bleichenbacher timing attack vulnerability in Cryptography.io's python-cryptography library affecting RSA decryption. Attackers can exploit timing differences to decrypt ciphertext. This article covers technical details, affected versions, security impact, and mitigation strategies.

Published:

CVE-2020-25659 Overview

CVE-2020-25659 is a timing attack vulnerability affecting the python-cryptography library version 3.2. The vulnerability exists in the RSA decryption API, which is susceptible to Bleichenbacher timing attacks through timed processing of valid PKCS#1 v1.5 ciphertext. This side-channel vulnerability allows attackers to potentially recover plaintext data by measuring decryption timing variations.

Critical Impact

Attackers can exploit timing differences in RSA decryption operations to gradually decrypt ciphertext without direct access to the private key, potentially exposing sensitive encrypted communications.

Affected Products

  • cryptography.io cryptography version 3.2
  • Oracle Communications Cloud Native Core Network Function Cloud Native Environment version 1.10.0

Discovery Timeline

  • 2021-01-11 - CVE CVE-2020-25659 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2020-25659

Vulnerability Analysis

The vulnerability resides in the RSA decryption implementation within python-cryptography 3.2. The Bleichenbacher attack exploits subtle timing differences that occur during the validation and decryption of PKCS#1 v1.5 padded ciphertext. When the library processes RSA-encrypted data, the time required to validate padding and decrypt varies based on the validity of the ciphertext structure. An attacker who can submit carefully crafted ciphertexts and measure the precise response times can use these timing variations to progressively determine the plaintext content.

This attack requires the attacker to have network access to a service performing RSA decryption operations and the ability to measure timing responses with sufficient precision. While the attack complexity is high due to the statistical nature of timing measurements and the number of oracle queries required, it represents a real threat to systems using PKCS#1 v1.5 padding for RSA operations.

Root Cause

The root cause of this vulnerability is classified under CWE-385 (Covert Timing Channel). The RSA decryption implementation does not process all ciphertext inputs in constant time. When handling PKCS#1 v1.5 formatted ciphertext, the code path execution time varies depending on the validity and structure of the padding bytes. This non-constant-time behavior creates a covert timing channel that leaks information about the decryption process.

Attack Vector

The attack vector is network-based, allowing remote exploitation without authentication or user interaction. An attacker must be able to:

  1. Submit arbitrary ciphertext to a target service that performs RSA decryption using the vulnerable library
  2. Measure the precise timing of decryption responses
  3. Perform a large number of oracle queries to statistically distinguish timing differences
  4. Reconstruct the plaintext using the Bleichenbacher adaptive chosen-ciphertext attack methodology

The attack typically requires thousands to millions of oracle queries depending on the precision of timing measurements and network conditions. Services exposed over networks with consistent latency are more susceptible to successful exploitation.

Detection Methods for CVE-2020-25659

Indicators of Compromise

  • Unusual volume of failed or malformed RSA decryption requests from a single source
  • Repeated decryption operations with varying ciphertext patterns targeting the same encrypted message
  • Statistical patterns in request timing consistent with oracle attack probing
  • Increased error rates in cryptographic operations without corresponding legitimate application errors

Detection Strategies

  • Monitor application logs for abnormal patterns of cryptographic operation failures
  • Implement rate limiting on endpoints performing RSA decryption to slow potential timing attacks
  • Deploy network traffic analysis to identify sustained high-frequency request patterns characteristic of oracle attacks
  • Audit dependency versions using software composition analysis tools to identify vulnerable cryptography library versions

Monitoring Recommendations

  • Track RSA decryption operation metrics including request volume, timing distributions, and error rates
  • Alert on anomalous increases in cryptographic operation latency variance
  • Monitor for dependency vulnerabilities through continuous security scanning in CI/CD pipelines
  • Correlate application performance metrics with security events to identify potential exploitation attempts

How to Mitigate CVE-2020-25659

Immediate Actions Required

  • Upgrade the cryptography Python package to a patched version (versions after 3.2 with the timing fix)
  • Audit applications to identify all usage of RSA decryption with PKCS#1 v1.5 padding
  • Consider migrating to OAEP (Optimal Asymmetric Encryption Padding) for RSA operations where possible
  • Review Oracle product deployments and apply patches per Oracle Security Alert April 2022 and Oracle Security Alert July 2022

Patch Information

The vulnerability has been addressed in the cryptography library. The fix is available through the GitHub Cryptography Pull Request which implements constant-time processing for RSA decryption operations to eliminate the timing oracle.

For Oracle Communications Cloud Native Core Network Function Cloud Native Environment deployments, apply the patches documented in the Oracle Critical Patch Updates from April 2022 and July 2022.

To update the cryptography package:

bash
pip install --upgrade cryptography

Workarounds

  • Implement application-level rate limiting on RSA decryption endpoints to increase attack difficulty
  • Add artificial random delays to cryptographic operation responses to obscure timing patterns (not a complete mitigation)
  • Where feasible, transition from PKCS#1 v1.5 padding to RSA-OAEP which is more resistant to padding oracle attacks
  • Deploy network-level protections to limit precision timing measurements by potential attackers
bash
# Verify cryptography package version
pip show cryptography | grep Version

# Upgrade to latest patched version
pip install cryptography --upgrade

# For requirements.txt, ensure minimum secure version
# cryptography>=3.3

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.