CVE-2019-18874: Double Free Vulnerability in psutil
Summary
CVE-2019-18874: psutil (aka python-psutil) through 5.6.5 can have a double free. Affects psutil versions < 5.6.6. Fixed in 5.6.6. How to fix ↓
Also tracked for
- python-psutil · Debian:11
The same CVE-2019-18874 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
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
psutil (aka python-psutil) is a Python library used for retrieving information on running processes and system utilization. It provides an interface to various system and process-related functionalities. The library is widely used in Python applications for monitoring system resources and managing processes. However, psutil versions up to 5.6.5 are vulnerable to a double free vulnerability.
Vulnerability Detail
The double free vulnerability in psutil occurs due to refcount mishandling within a while or for loop that converts system data into a Python object. This vulnerability can be exploited by an attacker to cause a denial of service or potentially execute arbitrary code. By carefully crafting a malicious input, an attacker can trigger the double free condition, leading to memory corruption and potentially allowing them to gain control over the affected system.
How To Fix
Minimum fixed version
5.6.6
This is the first release that contains the fix.
pip install --upgrade "psutil==5.6.6"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is strongly advised to upgrade to the latest version of psutil to mitigate the risk.
Conclusion
The double free vulnerability in psutil can have serious consequences, including denial of service and potential code execution. It is crucial to upgrade to the latest version of psutil (5.6.6 or later) to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for psutil →
FAQ
psutil is a Python library used for retrieving information on running processes and system utilization. It provides an interface to various system and process-related functionalities.
A double free vulnerability is a memory corruption issue that occurs when a program attempts to free the same memory block twice. This can lead to memory corruption, crashes, or potentially allow an attacker to execute arbitrary code.
The double free vulnerability in psutil can be exploited by an attacker to cause a denial of service or potentially execute arbitrary code. By carefully crafting a malicious input, an attacker can trigger the double free condition, leading to memory corruption and potentially allowing them to gain control over the affected system.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities in software using just the Pipfile.lock file.
You can find more information about this vulnerability in the psutil advisory database at https://github.com/pypa/advisory-database/blob/main/vulns/psutil/PYSEC-2019-41.yaml