CVE-2022-24302: Paramiko Race Condition Vulnerability
HIGHCVE-2022-24302 is a HIGH (CVSS 5.9) race condition vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting Paramiko libraries in the PyPI ecosystem. The issue involves race condition in paramiko. Remediation is available by upgrading affected packages to version 2.10.1, 2.9.3.
CVE-2022-24302 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2022-24302
To remediate this vulnerability, upgrade all affected Paramiko 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 paramiko>=2.10.1
pip install paramiko>=2.9.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show paramiko
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-24302, inspect your installed packages using pip:
pip show paramiko
Analyze the terminal output to locate any version of Paramiko in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.10.1), your application is affected.
Note: The pip show paramiko command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. In Paramiko, 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-2022-24302 Affected Paramiko Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
paramiko
|
PyPI |
≥ 2.10.0
< 2.10.1
|
2.10.1
|
|
paramiko
|
PyPI |
≥ 2.9.0
< 2.9.3
|
2.9.3
|
References
Frequently Asked Questions
What is CVE-2022-24302?
Which Paramiko versions are affected?
What version fixes CVE-2022-24302?
Is paramiko affected?
What is the CVSS score of CVE-2022-24302?
What CWE is associated with CVE-2022-24302?
How can I check PyPI dependencies for CVE-2022-24302?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f8q4-jwww-x3wv",
"modified" : "2025-12-20T02:31:13Z",
"published" : "2022-03-19T00:01:03Z",
"aliases" : [ "CVE-2022-24302" ],
"summary" : "Race Condition in Paramiko",
"details" : "In Paramiko before 2.10.1, a race condition (between creation and chmod) in the write_private_key_file function could allow unauthorized information disclosure.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "paramiko"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.10.0"
}, {
"fixed" : "2.10.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "paramiko"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.9.0"
}, {
"fixed" : "2.9.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24302"
}, {
"type" : "WEB",
"url" : "https://github.com/paramiko/paramiko/commit/4c491e299c9b800358b16fa4886d8d94f45abe2e"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-f8q4-jwww-x3wv"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/paramiko/paramiko"
}, {
"type" : "WEB",
"url" : "https://github.com/paramiko/paramiko/blob/363a28d94cada17f012c1604a3c99c71a2bda003/paramiko/pkey.py#L546"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/paramiko/PYSEC-2022-166.yaml"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2022/03/msg00032.html"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2022/09/msg00013.html"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2025/12/msg00020.html"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LUEUEGILZ7MQXRSUF5VMMO4SWJQVPTQL"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TPMKRUS4HO3P7NR7P4Y6CLHB4MBEE3AI"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/U63MJ2VOLLQ35R7CYNREUHSXYLWNPVSB"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LUEUEGILZ7MQXRSUF5VMMO4SWJQVPTQL"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TPMKRUS4HO3P7NR7P4Y6CLHB4MBEE3AI"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U63MJ2VOLLQ35R7CYNREUHSXYLWNPVSB"
}, {
"type" : "WEB",
"url" : "https://www.paramiko.org/changelog.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-362" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-03-29T20:52:09Z",
"nvd_published_at" : "2022-03-17T22:15:00Z"
}
}