CVE-2021-42343: Distributed Workers For Local Dask Clusters Vulnerability
CRITICALCVE-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
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).
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.
pip install distributed>=2021.10.0
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
CVE-2021-42343 Affected Distributed Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
distributed
|
PyPI |
< 2021.10.0
|
2021.10.0
|
References
Frequently Asked Questions
What is CVE-2021-42343?
Which Distributed versions are affected?
What version fixes CVE-2021-42343?
Is distributed affected?
What is the CVSS score of CVE-2021-42343?
What CWE is associated with CVE-2021-42343?
How can I check PyPI dependencies for CVE-2021-42343?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}