CVE-2026-16493: Ansible-core: argument injection in ansible-galaxy collection install via git clone (incomplete fix for cve-2026-11332)
A flaw was found in ansible-core. The extractcollectionfromgit() function in ansible-core's concreteartifactmanager.py constructs git clone commands without a '--' (end-of-options) separator before user-supplied URLs when installing collections from git sources. An attacker who provides a crafted collection source URI containing git argument injection payloads can achieve arbitrary command execution when a user runs 'ansible-galaxy collection install' with the malicious source. This is an incomplete fix for CVE-2026-11332, which hardened the role install path but missed the equivalent collection install code path.
Other sources
An argument injection vulnerability was found in ansible-core's collection install functionality. The extractcollectionfromgit() function in lib/ansible/galaxy/collection/concreteartifactmanager.py constructs git clone commands without a '--' (end-of-options) separator before user-supplied values. This allows an attacker to craft a malicious collection source URI (e.g. 'git+-ccore.sshCommand=sh -c "maliciouscommand"') that, when processed by 'ansible-galaxy collection install', causes git to interpret attacker-controlled input as command-line flags rather than positional arguments. Through the -ccore.sshCommand technique, this achieves arbitrary command execution without requiring any special git transport configuration.
This is an incomplete fix for CVE-2026-11332 (BZ#2485379, GHSA-w8p5-mx5w-cpqj). The CVE-2026-11332 fix added a '--' end-of-options separator to the ROLE install path in lib/ansible/utils/galaxy.py, but the analogous COLLECTION install path in lib/ansible/galaxy/collection/concreteartifactmanager.py was not hardened. The collection install path uses the same pattern of passing user-controlled git URLs directly to subprocess.checkcall() without the '--' guard.
Source code verification confirmed the vulnerability is present on all active branches (devel, stable-2.18, stable-2.17) as of 2026-07-21. The parsescm() function performs no security-relevant URL validation — no scheme check, no argument prefix check, no sanitization.
Additionally, the git checkout command in the same function also lacks '--' before the user-supplied version value, providing a secondary injection point.
— Red Hat
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-16493?
CVE-2026-16493 has a severity rating of high, with a score of 7.8.
How do I fix CVE-2026-16493?
To mitigate CVE-2026-16493, ensure you update ansible-core to the latest version where this vulnerability has been addressed.
What is CVE-2026-16493 about?
CVE-2026-16493 describes an argument injection vulnerability in ansible-galaxy related to insecure git clone commands.
Who is affected by CVE-2026-16493?
Any user of ansible-core who installs collections from git sources using vulnerable versions is at risk due to CVE-2026-16493.
Is there a workaround for CVE-2026-16493?
The recommended approach is to update to a patched version of ansible-core, as there are no reliable workarounds available for CVE-2026-16493.