CVE-2021-3702: Ansible runner Ansible-runner Vulnerable To Race Condition Vulnerability

MODERATE
Advisory Identifier: GHSA-772j-xvf9-qpf5
CVSS 6.3
CWE-362 CWE-377
Published
Advisory Summary

CVE-2021-3702 is a MODERATE (CVSS 6.3) ansible-runner vulnerable to race condition vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting Ansible runner libraries in the PyPI ecosystem. The issue involves ansible-runner vulnerable to race condition. Remediation is available by upgrading affected packages to version 2.1.0.

CVE-2021-3702 at a Glance

CVE Identifier CVE-2021-3702
GHSA Identifier GHSA-772j-xvf9-qpf5
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Affected Product Ansible runner
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.3

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:N/S:U/C:H/I:H/A:N).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2021-3702

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.

ansible-runner fixed: 2.1.0
pip install ansible-runner>=2.1.0
Verify Direct and Transitive Dependencies

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-3702, 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-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. 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

A race condition flaw was found in ansible-runner, where an attacker could watch for rapid creation and deletion of a temporary directory, substitute their directory at that name, and then have access to ansible-runner's private_data_dir the next time ansible-runner made use of the private_data_dir. The highest Threat out of this flaw is to integrity and confidentiality.

CVE-2021-3702 Affected Ansible runner Versions

1 component(s)
Fixed Versions:
2.1.0
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-3702?
CVE-2021-3702 is a security vulnerability in Ansible runner involving ansible-runner vulnerable to Race Condition under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition').
Which Ansible runner versions are affected?
Affected versions include releases prior to 2.1.0 across affected packages: ansible-runner.
What version fixes CVE-2021-3702?
Upgrading to 2.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ansible-runner affected?
Yes, ansible-runner is affected in releases prior to 2.1.0. Upgrade your dependency to 2.1.0 or later.
What is the CVSS score of CVE-2021-3702?
CVE-2021-3702 has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2021-3702?
CVE-2021-3702 is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') (The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.).
How can I check PyPI dependencies for CVE-2021-3702?
Run the dependency tree command: 'pip show ansible-runner'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-772j-xvf9-qpf5",
  "modified" : "2024-11-26T16:10:26Z",
  "published" : "2022-08-24T00:00:29Z",
  "aliases" : [ "CVE-2021-3702" ],
  "summary" : "ansible-runner vulnerable to Race Condition",
  "details" : "A race condition flaw was found in ansible-runner, where an attacker could watch for rapid creation and deletion of a temporary directory, substitute their directory at that name, and then have access to ansible-runner's private_data_dir the next time ansible-runner made use of the private_data_dir. The highest Threat out of this flaw is to integrity and confidentiality.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:P/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-3702"
  }, {
    "type" : "PACKAGE",
    "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://github.com/ansible/ansible-runner/commit/93e95a3df9021a38010386d07df121392d249253"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/security/cve/CVE-2021-3702"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1977965"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/ansible-runner/PYSEC-2022-43068.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-362", "CWE-377" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-01T22:17:50Z",
    "nvd_published_at" : "2022-08-23T16:15:00Z"
  }
}