CVE-2021-3701: Ansible runner Ansible-runner Has Default Temporary Files Vulnerability
MODERATECVE-2021-3701 is a MODERATE (CVSS 6.6) ansible-runner has default temporary files vulnerability (CWE-276: Incorrect Default Permissions) affecting Ansible runner libraries in the PyPI ecosystem. The issue involves ansible-runner has default temporary files written to world r/w locations. Remediation is available by upgrading affected packages to version 2.1.0.
CVE-2021-3701 at a Glance
Security Impact
CVSS: 6.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N).
How to Fix CVE-2021-3701
To remediate this vulnerability, upgrade all affected Ansible runner 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-runner>=2.1.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show ansible-runner
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2021-3701, inspect your installed packages using pip:
pip show ansible-runner
Analyze the terminal output to locate any version of Ansible runner in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.0), your application is affected.
Note: The pip show ansible-runner command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-276: Incorrect Default Permissions, where during installation, installed file permissions are set to allow anyone to modify those files. In Ansible runner, 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-3701 Affected Ansible runner Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ansible-runner
|
PyPI |
≥ 2.0.0
< 2.1.0
|
2.1.0
|
References
Frequently Asked Questions
What is CVE-2021-3701?
Which Ansible runner versions are affected?
What version fixes CVE-2021-3701?
Is ansible-runner affected?
What is the CVSS score of CVE-2021-3701?
What CWE is associated with CVE-2021-3701?
How can I check PyPI dependencies for CVE-2021-3701?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wwch-cmqr-hhrm",
"modified" : "2024-11-26T16:10:02Z",
"published" : "2022-08-24T00:00:29Z",
"aliases" : [ "CVE-2021-3701" ],
"summary" : "ansible-runner has default temporary files written to world R/W locations",
"details" : "A flaw was found in ansible-runner where the default temporary files configuration in ansible-2.0.0 are written to world R/W locations. This flaw allows an attacker to pre-create the directory, resulting in reading private information or forcing ansible-runner to write files as the legitimate user in a place they did not expect. The highest threat from this vulnerability is to confidentiality and integrity.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "ansible-runner"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.1.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-3701"
}, {
"type" : "WEB",
"url" : "https://github.com/ansible/ansible-runner/issues/738"
}, {
"type" : "WEB",
"url" : "https://github.com/ansible/ansible-runner/pull/742"
}, {
"type" : "WEB",
"url" : "https://github.com/ansible/ansible-runner/pull/742/commits"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/security/cve/CVE-2021-3701"
}, {
"type" : "WEB",
"url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1977959"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ansible/ansible-runner"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/ansible-runner/PYSEC-2022-43067.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-276" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-09-01T22:18:53Z",
"nvd_published_at" : "2022-08-23T16:15:00Z"
}
}