CVE-2021-3681
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedA 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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceWhen building Ansible Galaxy collections manually, any files in the repository directory not explicitly excluded via the `build_ignore` list in galaxy.yml are included in the generated .tar.gz archive. This inadvertently packages sensitive files such as API keys, credentials, or secrets from verbose output, which become publicly accessible to anyone downloading the collection.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data= 1.2= 3.3.0CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Local
- Complexity
- Low
- Privileges
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- None
- Availability
- None
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Verify Ansible Galaxy or Automation Platform versionRun `ansible-galaxy --version` or check the installed version of the ansible-galaxy packageAffected if The installed version is 3.3.0 for Galaxy or 1.2 for Ansible Automation Platform
-
Locate galaxy.yml files in collection repositoriesSearch for any galaxy.yml files in the repository or collection directories that have been used to build collectionsAffected if A galaxy.yml file exists and was used to build a collection package
-
Inspect build_ignore configurationOpen each galaxy.yml file and check if the `build_ignore` directive is defined and lists all sensitive file patternsAffected if The build_ignore directive is missing, incomplete, or does not cover sensitive files like *.key, *.pem, credentials, or secrets
-
Examine built collection archives for sensitive contentIf any .tar.gz archives exist from `ansible-galaxy collection build`, extract them (tar -xzf) and search for files containing keywords like 'password', 'secret', 'key', 'token', 'credential'Affected if The archive contains files with sensitive names or content that were not intentionally included for public distribution
-
Review repository for unignored sensitive filesCheck the repository directory for files that may contain secrets (such as .env files, *-secret.yml, id_rsa, api_keys.txt) and verify they are listed in build_ignoreAffected if Sensitive files exist in the repository directory but are not explicitly listed in build_ignore in galaxy.yml
A user is affected if they are running the specific affected versions AND have built collections without properly configuring build_ignore in galaxy.yml, resulting in sensitive files being packaged in their published collections.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scopedEnsure all sensitive files are explicitly listed in the `build_ignore` directive in galaxy.yml before building collections, and avoid including secrets in files within the repository directory. Review existing published collections for inadvertent secret exposure.
ansible-core >= 2.12 (or latest stable)
- 1. Identify the current version of ansible-core or ansible-galaxy CLI in use by running: ansible-galaxy --version
- 2. Upgrade ansible-core to the latest stable release that includes the fix for this vulnerability
- 3. If using ansible-builder, ensure it is also updated to the latest version
- 4. When building collections in the future, explicitly define a comprehensive build_ignore list in galaxy.yml to exclude sensitive files such as: .git, *.log, *secrets*, *password*, *.key, and any files containing API keys or credentials
- 5. Review all existing published collections and regenerate them without any sensitive files included
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation1.0 h
- Testing1.0 h
- Review / QA1.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $1,456.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2021-3681 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2021-3681 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data