Skip to content
Fencer Vulns
high 7.8

CVE-2021-4041 json

ansible-runner vulnerable to shell command injection

published 2022-08-24 4 y ago modified 2026-06-17 4 mo ago also GHSA-6j58-grhv-2769 , PYSEC-2022-253 , EUVD-2022-0003

cvss
7.8
version 3.1, NVD
cisa kev
Not listed
not in CISA's catalog
epss
0.3%
EPSS 0.3% chance of exploitation in 30 days, percentile 26%
public exploits
0
none known

Summary

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.

Patch / fix

  • pypi ansible-runner 2.1.0
  • redhat ansible_runner 2.1.0
  • ansible-runner Debian 14, Debian 13, Debian 12 2.1.1-1

debian advisories DEBIAN-CVE-2021-4041

  • ansible-runner Ubuntu 22.04 LTS 2.1.1-1

ubuntu advisories UBUNTU-CVE-2021-4041

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • ansible-runner ansible automation platform 2.0 2.0.3-2.el8ap
  • python38-ansible-runner ansible automation platform 2.0 2.0.3-2.el8ap

red hat advisories RHSA-2022:0108

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2021-4041 updated cvss 7.3

Ansible: Improper shell escaping in ansible-runner

  • Red Hat CloudForms Management Engine 5 ansible-runner, python2-ansible-runner, python3-ansible-runner Red Hat Ceph Storage 4 ansible-runner, python3-ansible-runner Red Hat OpenStack Platform 13 (Queens) python2-ansible-runner
    affected: no fix planned “Out of support scope”
  • Red Hat OpenStack Platform 16.1 python3-ansible-runner Red Hat OpenStack Platform 16.2 python3-ansible-runner Red Hat OpenStack Platform 17.0 python3-ansible-runner
    affected: no fix planned “Will not fix”
  • Red Hat Satellite 6 ansible-runner, python2-ansible-runner
    affected: no fix available
  • Red Hat Ansible Automation Platform 2.0 for RHEL 8 ansible-runner 2.0.3-2.el8ap, python38-ansible-runner 2.0.3-2.el8ap
    fixed: vendor fix RHSA-2022:0108
  • Red Hat OpenShift Container Platform 4 ansible-runner, python2-ansible-runner, python3-ansible-runner Red Hat Virtualization 4 ansible-runner, python3-ansible-runner, python38-ansible-runner
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

Exploit prediction

0.33% chance of exploitation in the next 30 days, higher than 26% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
NVD 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
GitHub 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
pypi ansible-runner
<2.1.0
2.1.0

Affected products

  • n/a ansible-runner

Classification

Weakness
  • CWE-20 Improper Input Validation
  • CWE-116 Improper Encoding or Escaping of Output

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.