Vulnerabilities in pkg:pypi/psutil
PACKAGECVE-2019-18874 is a HIGH (CVSS 7.5) double free vulnerability (CWE-415: Double Free) affecting Psutil libraries in the PyPI ecosystem. The issue involves double free in psutil. Remediation is available by upgrading affected packages to version 5.6.6.
pkg:pypi/psutil
Vulnerability advisories affecting package pkg:pypi/psutil. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-qfc5-mcwq-26q8 | CVE-2019-18874 | HIGH | Double Free in psutil |
CVE-2019-18874 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2019-18874
To remediate this vulnerability, upgrade all affected Psutil dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install psutil>=5.6.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show psutil
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2019-18874, inspect your installed packages using pip:
pip show psutil
Analyze the terminal output to locate any version of Psutil in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.6.6), your application is affected.
Note: The pip show psutil command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-415: Double Free, where the product calls free() twice on the same memory address. In Psutil, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2019-18874 Affected Psutil Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
psutil
|
PyPI |
< 5.6.6
|
5.6.6
|
References
Frequently Asked Questions
What is CVE-2019-18874?
Which Psutil versions are affected?
What version fixes CVE-2019-18874?
Is psutil affected?
What is the CVSS score of CVE-2019-18874?
What CWE is associated with CVE-2019-18874?
How can I check PyPI dependencies for CVE-2019-18874?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qfc5-mcwq-26q8",
"modified" : "2024-10-21T21:03:36Z",
"published" : "2020-03-12T17:02:50Z",
"aliases" : [ "CVE-2019-18874" ],
"summary" : "Double Free in psutil",
"details" : "psutil (aka python-psutil) through 5.6.5 can have a double free. This occurs because of refcount mishandling within a while or for loop that converts system data into a Python object.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "psutil"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.6.6"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 5.6.5"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-18874"
}, {
"type" : "WEB",
"url" : "https://github.com/giampaolo/psutil/pull/1616"
}, {
"type" : "WEB",
"url" : "https://github.com/giampaolo/psutil/commit/7d512c8e4442a896d56505be3e78f1156f443465"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-qfc5-mcwq-26q8"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/giampaolo/psutil"
}, {
"type" : "WEB",
"url" : "https://github.com/giampaolo/psutil/blob/master/HISTORY.rst#566"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/psutil/PYSEC-2019-41.yaml"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2019/11/msg00018.html"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2P7QI7MOTZTFXQYU23CP3RAWXCERMOAS"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OLETTJYZL2SMBUI4Q2NGBMGPDPP54SRG"
}, {
"type" : "WEB",
"url" : "https://usn.ubuntu.com/4204-1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-415" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-03-12T17:02:28Z",
"nvd_published_at" : null
}
}