CVE-2021-20228 is a high-severity (CVSS 7.5) Information Exposure vulnerability in ansible. A fix is available for ansible — see the affected versions and patch details below.
Ansible Exposes Sensitive Information
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
ansible🐍ansible🐍ansibleReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
A flaw was found in the Ansible Engine prior to 2.10.6rc1, 2.9.18rc1, and 2.8.19rc1, where sensitive info is not masked by default and is not protected by the no_log feature when using the sub-option feature of the basic.py module. This flaw allows an attacker to obtain sensitive information. The highest threat from this vulnerability is to confidentiality.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | ansible | ≥ 2.10.0a1&&< 2.10.6rc1 | 2.10.6rc1pip install --upgrade 'ansible==2.10.6rc1' |
| 🐍PyPI | ansible | ≥ 2.9.0a1&&< 2.9.18rc1 | 2.9.18rc1pip install --upgrade 'ansible==2.9.18rc1' |
| 🐍PyPI | ansible | all versions | 2.8.19rc1pip install --upgrade 'ansible==2.8.19rc1' |
Affected Products
debian linuxdebianansible automation platformredhatansible engineredhatansible towerredhatDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for ansible, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update ansible to 2.10.6rc1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-20228 is resolved across your whole dependency graph.
Workarounds
Assume what was exposed is already known: rotate any credential, token or key that the affected component could return, restrict the endpoint to callers that genuinely need it, and strip sensitive fields from responses and error output at the boundary rather than relying on the client not to read them.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Ansible Automation Platform 1.2 for RHEL 7 | ansible-automation-platform/platform-resource-operator-bundle:v0.1.1-1 | RHSA-2021:1079 |
| Red Hat Ansible Engine 2.9 for RHEL 7 | ansible-0:2.9.18-1.el7ae | RHSA-2021:0664 |
| Red Hat Ansible Engine 2 for RHEL 7 | ansible-0:2.9.18-1.el7ae | RHSA-2021:0663 |
| Red Hat Virtualization 4 for Red Hat Enterprise Linux 8 | ansible-0:2.9.18-1.el8ae | RHSA-2021:2180 |
Frequently Asked Questions
Is CVE-2021-20228 in your dependencies?
Find it across PyPI, including transitive dependencies.