Vulnerabilities in pkg:pypi/cookiecutter
PACKAGECVE-2022-24065 is a CRITICAL (CVSS 8.1) os command injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Cookiecutter libraries in the PyPI ecosystem. The issue involves os command injection in cookiecutter. Remediation is available by upgrading affected packages to version 2.1.1.
pkg:pypi/cookiecutter
Vulnerability advisories affecting package pkg:pypi/cookiecutter. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-f4q6-9qm4-h8j4 | CVE-2022-24065 | CRITICAL | OS Command Injection in cookiecutter |
CVE-2022-24065 at a Glance
Security Impact
CVSS: 8.1
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:H/A:H).
How to Fix CVE-2022-24065
To remediate this vulnerability, upgrade all affected Cookiecutter 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 cookiecutter>=2.1.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show cookiecutter
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-24065, inspect your installed packages using pip:
pip show cookiecutter
Analyze the terminal output to locate any version of Cookiecutter in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.1), your application is affected.
Note: The pip show cookiecutter command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Cookiecutter, 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-24065 Affected Cookiecutter Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
cookiecutter
|
PyPI |
< 2.1.1
|
2.1.1
|
References
Frequently Asked Questions
What is CVE-2022-24065?
Which Cookiecutter versions are affected?
What version fixes CVE-2022-24065?
Is cookiecutter affected?
What is the CVSS score of CVE-2022-24065?
What CWE is associated with CVE-2022-24065?
How can I check PyPI dependencies for CVE-2022-24065?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-f4q6-9qm4-h8j4",
"modified" : "2024-11-18T16:26:26Z",
"published" : "2022-06-09T23:48:49Z",
"aliases" : [ "CVE-2022-24065" ],
"summary" : "OS Command Injection in cookiecutter",
"details" : "The package cookiecutter before 2.1.1 is vulnerable to Command Injection via hg argument injection. When calling the cookiecutter function from Python code with the checkout parameter, it is passed to the hg checkout command in a way that additional flags can be set. The additional flags can be used to perform a command injection.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "cookiecutter"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.1.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24065"
}, {
"type" : "WEB",
"url" : "https://github.com/cookiecutter/cookiecutter/commit/fdffddb31fd2b46344dfa317531ff155e7999f77"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-f4q6-9qm4-h8j4"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/cookiecutter/cookiecutter"
}, {
"type" : "WEB",
"url" : "https://github.com/cookiecutter/cookiecutter/releases/tag/2.1.1"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/cookiecutter/PYSEC-2022-204.yaml"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/G5TXC4JYTNGOUFMCXPZ6QKWEZN3URTAK"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HQKWT7SGFDCUPPLDIELTN7FVTHWDL5YK"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-PYTHON-COOKIECUTTER-2414281"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-78" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-09T23:48:49Z",
"nvd_published_at" : "2022-06-08T08:15:00Z"
}
}