CVE-2021-3702: ansible-runner vulnerable to Race Condition
6.3
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.11913%
CWE
Published
8/24/2022
Updated
11/26/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| ansible-runner | pip | >= 2.0.0, < 2.1.0 | 2.1.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from insecure temporary directory handling. The pre-patch code in StreamWorker's init method used tempfile.TemporaryDirectory().name, which creates a directory that is immediately deleted when the TemporaryDirectory object is garbage collected. This created a race condition window where an attacker could replace the directory. The fix in commit 93e95a3 replaced this with mkdtemp() (which creates persistent unique directories) and removed the unsafe cleanup pattern. The GitHub PR #742/commits explicitly references this race condition fix in the StreamWorker initialization logic.