CVE-2021-3681 Information disclosure in ansible
Manual collection builds may leak sensitive API keys and secrets if not explicitly excluded, exposing them to anyone downloading the published collection.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2021-3681?
CVE-2021-3681 is a medium-severity vulnerability in ansible, published on 18 Apr 2022. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
A flaw was found in Ansible Galaxy Collections. When collections are built manually, any files in the repository directory that are not explicitly excluded via the ``build_ignore`` list in "galaxy.yml" include files in the ``.tar.gz`` file. This contains sensitive info, such as the user's Ansible Galaxy API key and any secrets in ``ansible`` or ``ansible-playbook`` verbose output without the``no_log`` redaction. Currently, there is no way to deprecate a Collection Or delete a Collection Version. Once published, anyone who downloads or installs the collection can view the secrets.
Weakness: CWE-522
Which versions are affected by CVE-2021-3681?
It affects 2 products.
Products include Redhat Ansible Automation Platform, Redhat Ansible Galaxy.
How do I fix CVE-2021-3681?
No fix has been published for CVE-2021-3681 yet. Limit exposure of the affected software until one is available.
Is CVE-2021-3681 being exploited?
There is no known exploitation of CVE-2021-3681 in the wild and no public exploit code.
Other vulnerabilities in ansible
- CVE-2021-4112 Privilege escalation in ansible-tower
- CVE-2023-4237 Platform: ec2_key module prints out the private key directly to the standard output
- CVE-2021-3583 Improper Input Validation and Command Injection in Ansible
- CVE-2025-9907 Event-driven-ansible: event stream test mode exposes sensitive headers in aap eda
- CVE-2025-9908 Event-driven-ansible: sensitive internal headers disclosure in aap eda event streams
Sources
Also known as GHSA-wh68-r6p4-7cv3.