CVE-2020-1734: Ansible OS Command Injection Vulnerability
HIGHCVE-2020-1734 is a HIGH (CVSS 7.4) os command injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Ansible libraries in the PyPI ecosystem. The issue involves os command injection in ansible. Remediation is available by upgrading affected packages to version 2.10.0rc1, 2.9.11, 2.8.13.
CVE-2020-1734 at a Glance
Security Impact
CVSS: 7.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:L).
How to Fix CVE-2020-1734
To remediate this vulnerability, upgrade all affected Ansible 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 ansible>=2.10.0rc1
pip install ansible>=2.9.11
pip install ansible>=2.8.13
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show ansible
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2020-1734, inspect your installed packages using pip:
pip show ansible
Analyze the terminal output to locate any version of Ansible in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.10.0rc1), your application is affected.
Note: The pip show ansible 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 Ansible, 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-2020-1734 Affected Ansible Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ansible
|
PyPI |
≥ 2.10.0a1
< 2.10.0rc1
|
2.10.0rc1
|
|
ansible
|
PyPI |
≥ 2.9.0a1
< 2.9.11
|
2.9.11
|
|
ansible
|
PyPI |
< 2.8.13
|
2.8.13
|
References
Frequently Asked Questions
What is CVE-2020-1734?
Which Ansible versions are affected?
What version fixes CVE-2020-1734?
Is ansible affected?
What is the CVSS score of CVE-2020-1734?
What CWE is associated with CVE-2020-1734?
How can I check PyPI dependencies for CVE-2020-1734?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h39q-95q5-9jfp",
"modified" : "2024-09-10T22:22:28Z",
"published" : "2022-02-09T00:11:19Z",
"aliases" : [ "CVE-2020-1734" ],
"summary" : "OS Command Injection in ansible",
"details" : "A flaw was found in the pipe lookup plugin of ansible. Arbitrary commands can be run, when the pipe lookup plugin uses `subprocess.Popen()` with `shell=True`, by overwriting ansible facts and the variable is not escaped by quote plugin. An attacker could take advantage and run arbitrary commands by overwriting the ansible facts.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:L"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:L/SC:H/SI:H/SA:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "ansible"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.10.0a1"
}, {
"fixed" : "2.10.0rc1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "ansible"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.9.0a1"
}, {
"fixed" : "2.9.11"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "ansible"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.8.13"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-1734"
}, {
"type" : "WEB",
"url" : "https://github.com/ansible/ansible/issues/67792"
}, {
"type" : "WEB",
"url" : "https://github.com/ansible/ansible/issues/70159"
}, {
"type" : "WEB",
"url" : "https://github.com/ansible/ansible/pull/70596"
}, {
"type" : "WEB",
"url" : "https://github.com/ansible/ansible/commit/4f978af4ca16ad9828ffe42203b9615425195f8b"
}, {
"type" : "WEB",
"url" : "https://github.com/ansible/ansible/commit/963bdd9983b91a48fb6949fb2ef41071e72d0be0"
}, {
"type" : "WEB",
"url" : "https://github.com/ansible/ansible/commit/bff0724e9eab2770f874e018298f9ab74cc2a78f"
}, {
"type" : "WEB",
"url" : "https://github.com/ansible/ansible/commit/e5649ca3e807f17e7c034ee22791f107162973b0"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/errata/RHBA-2020:0547"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/errata/RHBA-2020:1539"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/security/cve/CVE-2020-1734"
}, {
"type" : "WEB",
"url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1801804"
}, {
"type" : "WEB",
"url" : "https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2020-1734"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-h39q-95q5-9jfp"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ansible/ansible"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2020-6.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-78" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-04-02T18:38:15Z",
"nvd_published_at" : "2020-03-03T22:15:00Z"
}
}