Bug 2531646 (CVE-2026-89091)
| Summary: | CVE-2026-89091 ansible-core: ansible-core: ansible-galaxy collection install symlink path escape allows arbitrary file write / code execution | ||
|---|---|---|---|
| Product: | [Other] Security Response | Reporter: | OSIDB Bzimport <bzimport> |
| Component: | vulnerability | Assignee: | Product Security DevOps Team <prodsec-dev> |
| Status: | NEW --- | QA Contact: | |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | unspecified | CC: | akhatavk, anthomas, aos-team-art-private, asdas, brasmith, cahl, cochase, dpaolell, dranck, dschmidt, dymurray, eglynn, ehelms, ggainey, gparvin, jbalunas, jdelft, jjoyce, jlanda, jmitchel, jpasqual, jpretori, jsamir, jschluet, jupierce, juwatts, jwong, kbempah, kshier, lblicha, lbrazdil, lgarciaa, lhh, ljawale, mattdavi, mbiarnes, mburns, mclay, mdellweg, mgarciac, mhulan, mminar, mrunge, msilmser, nmoumoul, ogajduse, omaciel, osousa, pakotvan, pcreech, ppalepu, ppostler, prdhamdh, rbiba, rbobbitt, rchan, rhaigner, rhel-process-autobot, rjohnson, security-response-team, sghai, sidsharm, simaishi, sivel, smallamp, solenoci, sskracic, stcannon, sthirugn, suppawar, teagle, tguha, tmalecek, tpfromme, tsze, vimartin, vlaad, watson-tool-maintainers, yguenane, zhunting |
| Target Milestone: | --- | Keywords: | Security |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | --- | |
| Doc Text: |
A flaw was found in ansible-core. When installing a collection with `ansible-galaxy collection install`, the archive extractor validates member paths using lexical path normalisation (os.path.abspath) instead of resolving symbolic links (os.path.realpath), and it performs no containment check on symlink-typed directory members before creating them. A crafted collection tarball can chain symlink directory entries so that a subsequent file member is written outside the intended destination directory. This allows an attacker who can get a victim to install a malicious collection to overwrite arbitrary files with the privileges of the user running ansible-galaxy, leading to code execution on the control node. This is a bypass of the fix for CVE-2020-10691.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | --- | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Deadline: | 2026-09-25 | ||
When `ansible-galaxy collection install` extracts a collection, install_artifact() iterates the members listed in the attacker-controlled FILES.json and dispatches them to _extract_tar_dir() (directories and symlink-typed directory entries) or _extract_tar_file() (regular files). Containment is enforced by _is_child_path(), which normalises paths with os.path.abspath() (lexical) and never os.path.realpath(), and by _extract_tar_dir(), which checks only a symlink's target (lexically) and not the directory path it creates, calling os.makedirs(exist_ok=True) unconditionally. An attacker plants a symlink dir pointing at the destination root, then a nested symlink dir whose "../" segments cancel lexically (passing the check) but escape physically through the planted symlinks, then a regular file whose shutil.move() follows the escape symlink to write outside the destination. Result: arbitrary file write/overwrite as the installing user -> control-node code execution (e.g. ~/.bashrc, ~/.ssh/authorized_keys, a local action/lookup plugin, sitecustomize.py; as root /etc/cron.d, systemd units). The default install performs no signature check, and a signed malicious collection still passes MANIFEST.json verification (done before, and independent of, the FILES.json member loop) because the attacker signs their own archive. Upstream: https://github.com/ansible/ansible (devel) - fix pending Affected file: lib/ansible/galaxy/collection/__init__.py _is_child_path (lexical abspath, no realpath), _extract_tar_dir (no containment on dir path; unconditional makedirs), _extract_tar_file (shutil.move follows symlink), install_artifact (loops attacker-authored FILES.json)