Vulnerabilities in pkg:pypi/joblib
PACKAGECVE-2022-21797 is a CRITICAL (CVSS 9.8) joblib vulnerable to arbitrary code vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Joblib libraries in the PyPI ecosystem. The issue involves joblib vulnerable to arbitrary code execution. Remediation is available by upgrading affected packages to version 1.2.0.
pkg:pypi/joblib
Vulnerability advisories affecting package pkg:pypi/joblib. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-6hrg-qmvc-2xh8 | CVE-2022-21797 | CRITICAL | joblib vulnerable to arbitrary code execution |
CVE-2022-21797 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-2022-21797
To remediate this vulnerability, upgrade all affected Joblib 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 joblib>=1.2.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show joblib
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-21797, inspect your installed packages using pip:
pip show joblib
Analyze the terminal output to locate any version of Joblib in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.0), your application is affected.
Note: The pip show joblib command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Joblib, 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-21797 Affected Joblib Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
joblib
|
PyPI |
< 1.2.0
|
1.2.0
|
References
Frequently Asked Questions
What is CVE-2022-21797?
Which Joblib versions are affected?
What version fixes CVE-2022-21797?
Is joblib affected?
What is the CVSS score of CVE-2022-21797?
What CWE is associated with CVE-2022-21797?
How can I check PyPI dependencies for CVE-2022-21797?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-6hrg-qmvc-2xh8",
"modified" : "2024-09-23T19:29:43Z",
"published" : "2022-09-27T00:00:22Z",
"aliases" : [ "CVE-2022-21797" ],
"summary" : "joblib vulnerable to arbitrary code execution",
"details" : "The package joblib from 0 and before 1.2.0 is vulnerable to Arbitrary Code Execution via the `pre_dispatch` flag in `Parallel()` class due to the `eval()` statement.",
"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" : "joblib"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.2.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-21797"
}, {
"type" : "WEB",
"url" : "https://github.com/joblib/joblib/issues/1128"
}, {
"type" : "WEB",
"url" : "https://github.com/joblib/joblib/pull/1321"
}, {
"type" : "WEB",
"url" : "https://github.com/joblib/joblib/pull/1327"
}, {
"type" : "WEB",
"url" : "https://github.com/joblib/joblib/pull/1352"
}, {
"type" : "WEB",
"url" : "https://github.com/joblib/joblib/commit/6638b9e9711ad1ebbf6dd95aa7cee0dca9897b42"
}, {
"type" : "WEB",
"url" : "https://github.com/joblib/joblib/commit/b90f10efeb670a2cc877fb88ebb3f2019189e059"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/SNYK-PYTHON-JOBLIB-3027033"
}, {
"type" : "WEB",
"url" : "https://security.gentoo.org/glsa/202401-01"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MJ5XTJS6OKJRRVXWFN5J67K3BYPEOBDF"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BVOMMW37OXZWU2EV5ONAAS462IQEHZOF"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MJ5XTJS6OKJRRVXWFN5J67K3BYPEOBDF"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BVOMMW37OXZWU2EV5ONAAS462IQEHZOF"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2023/03/msg00027.html"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2022/11/msg00020.html"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/joblib/PYSEC-2022-288.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/joblib/joblib"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2022-09-30T04:44:04Z",
"nvd_published_at" : "2022-09-26T05:15:00Z"
}
}