CVE-2021-4041
ansible-runner vulnerable to shell command injection
CVE-2021-4041 is a high vulnerability (CVSS 7.8) in Redhat Ansible Runner, published August 24, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.33%, the 26th percentile. Fixed in ansible-runner 2.1.0.
A flaw was found in ansible-runner. An improper escaping of the shell command, while calling the ansible_runner.interface.run_command, can lead to parameters getting executed as host's shell command. A developer could unintentionally write code that gets executed in the host rather than the virtual environment.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
7.8
A flaw was found in ansible-runner. An improper escaping of the shell command, while calling the ansible_runner.interface.run_command, can lead to parameters getting executed as host's shell command. A developer could unintentionally write code that gets executed in the host rather than the virtual environment.
- Record
CVE-2021-4041- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-20, CWE-116
- Updated
- 2026-11-02
CVE List No score
A flaw was found in ansible-runner. An improper escaping of the shell command, while calling the ansible_runner.interface.run_command, can lead to parameters getting executed as host's shell command. A developer could unintentionally write code that gets executed in the host rather than the virtual environment.
- Record
CVE-2021-4041- Weakness
- CWE-20
- Updated
- 2026-11-02
EUVDEUVD-2022-0003 No score
A flaw was found in ansible-runner. An improper escaping of the shell command, while calling the ansible_runner.interface.run_command, can lead to parameters getting executed as host's shell command. A developer could unintentionally write code that gets executed in the host rather than the virtual environment.
- Record
EUVD-2022-0003- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-6j58-grhv-2769
8.5
ansible-runner vulnerable to shell command injection
A flaw was found in ansible-runner. An improper escaping of the shell command, while calling the ansible_runner.interface.run_command, can lead to parameters getting executed as host's shell command. A developer could unintentionally write code that gets executed in the host rather than the virtual environment.
- Record
GHSA-6j58-grhv-2769- CVSS 4.0
- 8.5 High
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-20, CWE-116
- Updated
- 2026-11-02
OSV
7.8
A flaw was found in ansible-runner. An improper escaping of the shell command, while calling the ansible_runner.interface.run_command, can lead to parameters getting executed as host's shell command. A developer could unintentionally write code that gets executed in the host rather than the virtual environment.
- Record
CVE-2021-4041- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2021-4041
7.8
A flaw was found in ansible-runner. An improper escaping of the shell command, while calling the ansible_runner.interface.run_command, can lead to parameters getting executed as host's shell command. A developer could unintentionally write code that gets executed in the host rather than the virtual environment.
- Record
DEBIAN-CVE-2021-4041- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Show 4 moreShow less
OSVGHSA-6j58-grhv-2769
8.5
ansible-runner vulnerable to shell command injection
A flaw was found in ansible-runner. An improper escaping of the shell command, while calling the ansible_runner.interface.run_command, can lead to parameters getting executed as host's shell command. A developer could unintentionally write code that gets executed in the host rather than the virtual environment.
- Record
GHSA-6j58-grhv-2769- CVSS 4.0
- 8.5 High
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-116, CWE-20
- Updated
- 2026-11-02
OSVRHSA-2022:0108
7.3
Red Hat Security Advisory: ansible-runner security and bug fix update
- Record
RHSA-2022:0108- CVSS 3.1
- 7.3 High
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVUBUNTU-CVE-2021-4041
7.8
A flaw was found in ansible-runner. An improper escaping of the shell command, while calling the ansible_runner.interface.run_command, can lead to parameters getting executed as host's shell command. A developer could unintentionally write code that gets executed in the host rather than the virtual environment.
- Record
UBUNTU-CVE-2021-4041- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVPYSEC-2022-253 No score
A flaw was found in ansible-runner. An improper escaping of the shell command, while calling the ansible_runner.interface.run_command, can lead to parameters getting executed as host's shell command. A developer could unintentionally write code that gets executed in the host rather than the virtual environment.
- Record
PYSEC-2022-253- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
ansible-runnerPyPI |
before 2.1.0 | 2.1.0 |
ansible-runnerDebian:12 |
before 2.1.1-1 | 2.1.1-1 |
ansible-runnerDebian:13 |
before 2.1.1-1 | 2.1.1-1 |
ansible-runnerDebian:14 |
before 2.1.1-1 | 2.1.1-1 |
ansible-runnerPyPI |
before 2.1.0, plus listed versions 1.0.11.0.21.0.31.0.41.0.5 Show 35 moreShow less1.1.01.1.11.1.21.2.01.3.01.3.11.3.21.3.31.3.41.4.01.4.11.4.21.4.41.4.51.4.61.4.71.4.81.4.92.0.02.0.0.0a52.0.0.0b12.0.0.0rc12.0.0.0rc22.0.0.0rc32.0.0a12.0.0a22.0.0a32.0.0a42.0.12.0.22.0.32.0.42.1.0.0a12.1.0.0a22.1.0.0b1 |
2.1.0 |
ansible-runnerRed Hat:ansible_automation_platform:2.0::el8 |
before 0:2.0.3-2.el8ap | 0:2.0.3-2.el8ap |
python38-ansible-runnerRed Hat:ansible_automation_platform:2.0::el8 |
before 0:2.0.3-2.el8ap | 0:2.0.3-2.el8ap |
ansible-runnerUbuntu:22.04:LTS |
before 2.1.1-1, plus listed versions 1.4.6-11.4.6-1.1 |
2.1.1-1 |
History
| When | Changed | Sources |
|---|---|---|
| 2026-11-03 | aliases | EUVD |
| 2026-11-02 | created | CVE List, GitHub Advisories, NVD, OSV |
References
bugzilla.redhat.com/show_bug.cgi?id=2028074
access.redhat.com/security/cve/CVE-2021-4041
github.com/ansible/ansible-runner/commit/3533f265f4349a3f2a0283158cd01b59a6bbc7bd
nvd.nist.gov/vuln/detail/CVE-2021-4041
github.com/pypa/advisory-database/tree/main/vulns/ansible-runner/PYSEC-2022-253.yaml
github.com/advisories/GHSA-6j58-grhv-2769
Show 7 moreShow less
security-tracker.debian.org/tracker/CVE-2021-4041
github.com/ansible/ansible-runner
access.redhat.com/errata/RHSA-2022:0108
access.redhat.com/security/updates/classification
security.access.redhat.com/data/csaf/v2/advisories/2022/rhsa-2022_0108.json
cve.org/CVERecord?id=CVE-2021-4041
ubuntu.com/security/CVE-2021-4041