REDHAT-BUG-2503724: High severity ansible-core vulnerability
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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ansible-coreto a version that resolves this vulnerability.Patch BZ#2485379 - Configuration
Ensure the ROLE install git command uses the '--' end-of-options separator before any user-supplied value (as described in the CVE-2026-11332 fix).
ansible-core (lib/ansible/utils/galaxy.py) ROLE install path add '--' end-of-options separator to git invocation in ROLE install path = --
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-2503724?
The severity of REDHAT-BUG-2503724 is categorized as high with a CVSS score of 7.
How do I fix REDHAT-BUG-2503724?
To fix REDHAT-BUG-2503724, ensure you update to the latest patched version of ansible-core.
What type of vulnerability is REDHAT-BUG-2503724?
REHAT-BUG-2503724 is an argument injection vulnerability affecting the collection install functionality in ansible-core.
What component of ansible-core is affected by REDHAT-BUG-2503724?
The _extract_collection_from_git() function in lib/ansible/galaxy/collection/concrete_artifact_manager.py is the affected component.
What are the potential impacts of REDHAT-BUG-2503724?
The vulnerability may allow an attacker to inject arbitrary commands into git clone operations, leading to potential code execution.