Critical Vulnerability in Python-RSA: Leading Zero Bytes Ignored During Decryption
Summary
UBUNTU-CVE-2020-13757: Python-RSA before 4.1 ignores leading '\0' bytes during decryption of ciphertext. Affects python-rsa versions < 3.1.2-1ubuntu0.1+esm1. Fixed in 3.1.2-1ubuntu0.1+esm1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Python-RSA is a widely used library for implementing RSA encryption in Python applications. It provides functionalities for key generation, encryption, and decryption, making it essential for secure communications. However, the library has a vulnerability that allows it to ignore leading '\0' bytes during the decryption process, potentially exposing applications to security risks.
Vulnerability Detail
The vulnerability, identified as CVE-2020-13757, arises from Python-RSA versions prior to 4.1, which fail to handle leading '\0' bytes in ciphertext correctly. This oversight can lead to security implications, such as enabling attackers to deduce that an application is utilizing Python-RSA. Additionally, if the length of the accepted ciphertext influences application behavior, it could result in excessive memory allocation, leading to potential denial-of-service scenarios.
How To Fix
Minimum fixed version
3.1.2-1ubuntu0.1+esm1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade python-rsa
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, consider implementing input validation to check for leading '\0' bytes in the ciphertext before decryption. This can help mitigate the risk until the package is updated.
Conclusion
The Python-RSA library has a critical vulnerability that can lead to significant security risks if not addressed. Users are urged to update to the latest patched version to ensure their applications remain secure. Utilizing tools like Vulert can help monitor for such vulnerabilities effectively.
See every vulnerability recorded for python-rsa →
FAQ
CVE-2020-13757 is a vulnerability in the Python-RSA library that allows leading '\0' bytes to be ignored during decryption, potentially leading to security risks.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without requiring signup.
The consequences may include unauthorized inference of application behavior by attackers and potential denial-of-service due to excessive memory allocation.
Yes, a patched version of Python-RSA is available. Users should update to version 4.1 or later to mitigate the vulnerability.
The CVSS score of this vulnerability is 7.5, indicating a high severity level.
Related vulnerabilities
Recent vulnerabilities recorded for python-rsa.