Bug 2503755

Summary: CVE-2026-16493 ansible-core: argument injection in ansible-galaxy collection install via git clone (incomplete fix for CVE-2026-11332) [fedora-44]
Product: [Fedora] Fedora Reporter: Borja Tarraso <btarraso>
Component: ansible-coreAssignee: Kevin Fenzi <kevin>
Status: NEW --- QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 44CC: kevin, maxwell, moi
Target Milestone: ---Keywords: Security, SecurityTracking
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: {"flaws": ["a9221b0d-2da9-43f2-8b59-b7cd16670e37"]}
Fixed In Version: Doc Type: ---
Doc Text:
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:
Bug Depends On:    
Bug Blocks: 2503724    

Description Borja Tarraso 2026-07-21 17:17:15 UTC
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.

An argument injection vulnerability was found in ansible-core's collection install functionality. The _extract_collection_from_git() function in lib/ansible/galaxy/collection/concrete_artifact_manager.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 "malicious_command"') 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/concrete_artifact_manager.py was not hardened. The collection install path uses the same pattern of passing user-controlled git URLs directly to subprocess.check_call() 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 parse_scm() 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.