Bug 2531646 (CVE-2026-89091) - CVE-2026-89091 ansible-core: ansible-core: ansible-galaxy collection install symlink path escape allows arbitrary file write / code execution
Summary: CVE-2026-89091 ansible-core: ansible-core: ansible-galaxy collection install ...
Keywords:
Status: NEW
Alias: CVE-2026-89091
Deadline: 2026-09-25
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-09-10 20:26 UTC by OSIDB Bzimport
Modified: 2026-11-17 13:10 UTC (History)
80 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2026-09-10 20:26:10 UTC
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)


Note You need to log in before you can comment on or make changes to this bug.