CVE-2020-25658

7.5 HIGH

📋 TL;DR

CVE-2020-25658 is a timing side-channel vulnerability in python-rsa that allows attackers to perform Bleichenbacher attacks against RSA decryption. This enables partial decryption of ciphertexts encrypted with RSA. Any system using vulnerable versions of python-rsa for RSA decryption operations is affected.

💻 Affected Systems

Products:
  • python-rsa
Versions: All versions before 4.7
Operating Systems: All operating systems running Python
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems using python-rsa's RSA decryption functionality. Encryption operations are not vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could decrypt sensitive data protected by RSA encryption, potentially exposing confidential information, authentication tokens, or session keys.

🟠

Likely Case

Partial decryption of RSA-encrypted data over time through repeated timing measurements, potentially exposing structured data patterns or partial secrets.

🟢

If Mitigated

With constant-time RSA decryption implementations, the timing side-channel is eliminated, preventing the attack.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: LOW

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires the attacker to have access to make RSA decryption requests and measure timing differences. The attack is well-documented in cryptographic literature.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: python-rsa 4.7 and later

Vendor Advisory: https://github.com/sybrenstuvel/python-rsa/security/advisories/GHSA-8wch-w2g2-8pmc

Restart Required: No

Instructions:

1. Update python-rsa to version 4.7 or later using pip: 'pip install python-rsa>=4.7' 2. Verify the update with: 'pip show python-rsa' 3. Restart any Python applications using the library.

🔧 Temporary Workarounds

Disable RSA decryption

all

Temporarily disable RSA decryption functionality if not required

Use alternative RSA library

all

Switch to a different RSA implementation with constant-time operations

🧯 If You Can't Patch

  • Implement network-level rate limiting on RSA decryption endpoints
  • Use application-level monitoring for abnormal timing patterns in decryption operations

🔍 How to Verify

Check if Vulnerable:

Check python-rsa version with: 'python -c "import rsa; print(rsa.__version__)"' or 'pip show python-rsa'

Check Version:

python -c "import rsa; print(rsa.__version__)"

Verify Fix Applied:

Verify version is 4.7 or higher: 'python -c "import rsa; print('VULNERABLE' if tuple(map(int, rsa.__version__.split('.'))) < (4,7) else 'PATCHED')"'

📡 Detection & Monitoring

Log Indicators:

  • Unusually high volume of RSA decryption requests
  • Requests with malformed or specially crafted RSA ciphertexts

Network Indicators:

  • Repeated RSA decryption requests with timing measurements
  • Traffic patterns suggesting timing side-channel attacks

SIEM Query:

source=application_logs AND (rsa_decryption_count > threshold OR rsa_decryption_time_variance > threshold)

🔗 References

📤 Share & Export