CVE-2021-42343: Distributed Workers For Local Dask Clusters Vulnerability

CRITICAL
Advisory Identifier: GHSA-hwqr-f3v9-hwxr
CVSS 9.8
CWE-668
Published
Advisory Summary

CVE-2021-42343 is a CRITICAL (CVSS 9.8) workers for local dask clusters vulnerability (CWE-668: Exposure of Resource to Wrong Sphere) affecting Distributed libraries in the PyPI ecosystem. The issue involves workers for local dask clusters mistakenly listened on public interfaces. Remediation is available by upgrading affected packages to version 2021.10.0.

CVE-2021-42343 at a Glance

CVE Identifier CVE-2021-42343
GHSA Identifier GHSA-hwqr-f3v9-hwxr
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-668: Exposure of Resource to Wrong Sphere
Affected Product Distributed
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.8

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:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2021-42343

To remediate this vulnerability, upgrade all affected Distributed dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

distributed fixed: 2021.10.0
pip install distributed>=2021.10.0
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 distributed

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2021-42343, inspect your installed packages using pip:

pip show distributed

Analyze the terminal output to locate any version of Distributed in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2021.10.0), your application is affected.

Note: The pip show distributed command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-668: Exposure of Resource to Wrong Sphere, where the product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. In Distributed, 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

Versions of `distributed` earlier than `2021.10.0` had a potential security vulnerability relating to single-machine Dask clusters. Clusters started with `dask.distributed.LocalCluster` or `dask.distributed.Client()` (which defaults to using `LocalCluster`) would mistakenly configure their respective Dask workers to listen on external interfaces (typically with a randomly selected high port) rather than only on `localhost`. A Dask cluster created using this method AND running on a machine that has these ports exposed could be used by a sophisticated attacker to enable remote code execution. Users running on machines with standard firewalls in place, or using clusters created via cluster objects other than `LocalCluster` (e.g. `dask_kubernetes.KubeCluster`) should not be affected. This vulnerability is documented in CVE-2021-42343, and was fixed in version `2021.10.0` (PR #5427).

CVE-2021-42343 Affected Distributed Versions

1 component(s)
Fixed Versions:
2021.10.0
Product / Package Ecosystem Affected Versions Fixed Version
distributed
PyPI
< 2021.10.0
2021.10.0

References

Frequently Asked Questions

What is CVE-2021-42343?
CVE-2021-42343 is a security vulnerability in Distributed involving Workers for local Dask clusters mistakenly listened on public interfaces under CWE-668: Exposure of Resource to Wrong Sphere.
Which Distributed versions are affected?
Affected versions include releases prior to 2021.10.0 across affected packages: distributed.
What version fixes CVE-2021-42343?
Upgrading to 2021.10.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is distributed affected?
Yes, distributed is affected in releases prior to 2021.10.0. Upgrade your dependency to 2021.10.0 or later.
What is the CVSS score of CVE-2021-42343?
CVE-2021-42343 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2021-42343?
CVE-2021-42343 is classified under CWE-668: Exposure of Resource to Wrong Sphere (The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.).
How can I check PyPI dependencies for CVE-2021-42343?
Run the dependency tree command: 'pip show distributed'. 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-hwqr-f3v9-hwxr",
  "modified" : "2026-02-03T17:37:34Z",
  "published" : "2022-07-15T21:56:08Z",
  "aliases" : [ "CVE-2021-42343" ],
  "summary" : "Workers for local Dask clusters mistakenly listened on public interfaces",
  "details" : "Versions of `distributed` earlier than `2021.10.0` had a potential security vulnerability relating to single-machine Dask clusters.\n\nClusters started with `dask.distributed.LocalCluster` or `dask.distributed.Client()` (which defaults to using `LocalCluster`) would mistakenly configure their respective Dask workers to listen on external interfaces (typically with a randomly selected high port) rather than only on `localhost`. A Dask cluster created using this method AND running on a machine that has these ports exposed could be used by a sophisticated attacker to enable remote code execution. Users running on machines with standard firewalls in place, or using clusters created via cluster objects other than `LocalCluster` (e.g. `dask_kubernetes.KubeCluster`) should not be affected. This vulnerability is documented in CVE-2021-42343, and was fixed in version `2021.10.0` (PR #5427).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "distributed"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2021.10.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/dask/distributed/security/advisories/GHSA-hwqr-f3v9-hwxr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-42343"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dask/distributed/pull/5427"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dask/distributed/commit/afce4be8e05fb180e50a9d9e38465f1a82295e1b"
  }, {
    "type" : "WEB",
    "url" : "https://docs.dask.org/en/latest/changelog.html"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dask/dask/tags"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/dask/distributed"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/distributed/PYSEC-2021-871.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/distributed/PYSEC-2021-872.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-668" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-07-15T21:56:08Z",
    "nvd_published_at" : null
  }
}