CVE-2022-24302: Paramiko Race Condition Vulnerability

HIGH
Advisory Identifier: GHSA-f8q4-jwww-x3wv
CVSS 5.9
CWE-362
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2022-24302
GHSA Identifier GHSA-f8q4-jwww-x3wv
Severity HIGH
CVSS v3.1 Base Score 5.9
CWE Classification CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Affected Product Paramiko
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (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.

paramiko fixed: 2.10.1
pip install paramiko>=2.10.1
paramiko fixed: 2.9.3
pip install paramiko>=2.9.3
Verify Direct and Transitive Dependencies

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

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.

CVE-2022-24302 Affected Paramiko Versions

2 component(s)
Fixed Versions:
2.10.12.9.3
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

NVD — CVE-2022-24302 NVD
https://nvd.nist.gov/vuln/detail/CVE-2022-24302
Security Fix Commit FIX COMMIT
https://github.com/paramiko/paramiko/commit/4c491e299c9b800358b16fa4886d8d94f45abe2e
GitHub Advisory / Wiki ADVISORY
https://github.com/advisories/GHSA-f8q4-jwww-x3wv
Paramiko Source Repository REPOSITORY
https://github.com/paramiko/paramiko
Paramiko Source Repository REPOSITORY
https://github.com/paramiko/paramiko/blob/363a28d94cada17f012c1604a3c99c71a2bda003/paramiko/pkey.py#L546
Paramiko Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/paramiko/PYSEC-2022-166.yaml
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2022/03/msg00032.html
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2022/09/msg00013.html
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2025/12/msg00020.html
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LUEUEGILZ7MQXRSUF5VMMO4SWJQVPTQL
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TPMKRUS4HO3P7NR7P4Y6CLHB4MBEE3AI
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/U63MJ2VOLLQ35R7CYNREUHSXYLWNPVSB
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LUEUEGILZ7MQXRSUF5VMMO4SWJQVPTQL
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TPMKRUS4HO3P7NR7P4Y6CLHB4MBEE3AI
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U63MJ2VOLLQ35R7CYNREUHSXYLWNPVSB
Paramiko Security Information SECURITY
https://www.paramiko.org/changelog.html

Frequently Asked Questions

What is CVE-2022-24302?
CVE-2022-24302 is a security vulnerability in Paramiko involving Race Condition in Paramiko under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition').
Which Paramiko versions are affected?
Affected versions include releases prior to 2.10.1, 2.9.3 across affected packages: paramiko.
What version fixes CVE-2022-24302?
Upgrading to 2.10.1, 2.9.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is paramiko affected?
Yes, paramiko is affected in releases prior to 2.10.1, 2.9.3. Upgrade your dependency to 2.10.1, 2.9.3 or later.
What is the CVSS score of CVE-2022-24302?
CVE-2022-24302 has a CVSS v3.1 base score of 5.9 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2022-24302?
CVE-2022-24302 is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') (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.).
How can I check PyPI dependencies for CVE-2022-24302?
Run the dependency tree command: 'pip show paramiko'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}