Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-16493

CVE-2026-16493: Ansible Core RCE Vulnerability

CVE-2026-16493 is a remote code execution flaw in ansible-core caused by improper git command construction. Attackers can execute arbitrary commands via malicious collection URIs. This article covers technical details, affected versions, impact, and mitigation strategies.

Published:

CVE-2026-16493 Overview

CVE-2026-16493 is a command injection vulnerability in ansible-core affecting the collection install code path. The _extract_collection_from_git() function in concrete_artifact_manager.py builds git clone commands without inserting a -- end-of-options separator before user-supplied URLs. An attacker who controls a collection source URI can inject git command-line arguments and achieve arbitrary command execution when a user runs ansible-galaxy collection install. The flaw represents an incomplete fix for CVE-2026-11332, which hardened the role install path but left the equivalent collection install path vulnerable. The weakness is classified under [CWE-88] Argument Injection.

Critical Impact

A crafted collection source URI can trigger arbitrary command execution on the host running ansible-galaxy collection install, compromising confidentiality, integrity, and availability of the automation controller.

Affected Products

  • ansible-core (collection install path in concrete_artifact_manager.py)
  • Red Hat Ansible Automation Platform distributions bundling affected ansible-core versions
  • Any workflow invoking ansible-galaxy collection install against untrusted git sources

Discovery Timeline

  • 2026-07-21 - CVE-2026-16493 published to NVD
  • 2026-07-22 - Last updated in NVD database

Technical Details for CVE-2026-16493

Vulnerability Analysis

The vulnerability resides in the collection install workflow of ansible-core. When a user requests installation of a collection from a git source, _extract_collection_from_git() in concrete_artifact_manager.py assembles a git clone command using the caller-supplied URI. The URI is placed directly on the command line without a -- sentinel that would force git to stop parsing options. Git therefore interprets a URI beginning with - or -- as an option rather than a repository location. Options such as --upload-pack and --config allow an attacker to designate an executable helper or inject configuration that runs external commands during the clone. Execution occurs under the identity of the user running ansible-galaxy, which in CI or automation contexts often carries elevated privileges.

Root Cause

The root cause is missing argument boundary enforcement. The CVE-2026-11332 remediation added the -- separator to the role install path but did not apply the same hardening to the collection install path. The two code paths handle equivalent user input yet diverged in defensive posture, leaving argument injection reachable through collection sources.

Attack Vector

Exploitation requires user interaction: a victim must install a collection from an attacker-controlled or attacker-influenced source, for example through a poisoned requirements.yml, a compromised mirror, or social engineering directing a developer to run ansible-galaxy collection install <malicious-uri>. The attack vector is local to the host executing the install command. No authentication to Ansible itself is required. See the Red Hat CVE-2026-16493 Advisory and Red Hat Bug Report #2503724 for upstream analysis.

No verified public exploit code is available at the time of publication. The vulnerability mechanism follows the well-documented git argument injection pattern in which crafted URIs beginning with --upload-pack= cause git to execute the specified binary during clone.

Detection Methods for CVE-2026-16493

Indicators of Compromise

  • Execution of git clone child processes with arguments beginning with --upload-pack=, --config=, or other option-like tokens where a URL is expected
  • ansible-galaxy process trees spawning unexpected shells, interpreters, or network utilities
  • requirements.yml files containing collection source entries whose values start with - or --

Detection Strategies

  • Inspect requirements.yml and CI pipeline definitions for collection sources that do not begin with a scheme such as https://, git@, or git+https://
  • Alert on process lineage where ansible-galaxy is the parent of processes unrelated to git operations, such as bash, curl, wget, or python invoking outbound connections
  • Correlate ansible-galaxy collection install invocations with subsequent file writes to ~/.ssh, ~/.bashrc, or CI runner credential paths

Monitoring Recommendations

  • Enable command-line auditing on hosts and CI runners that execute ansible-galaxy to capture full argument vectors
  • Baseline the expected set of collection sources and flag deviations before installation runs
  • Forward ansible-galaxy and git process telemetry to a centralized analytics platform for retroactive hunting once patched versions are deployed

How to Mitigate CVE-2026-16493

Immediate Actions Required

  • Upgrade ansible-core to a fixed release as published in the Red Hat CVE-2026-16493 Advisory once available for your distribution
  • Restrict ansible-galaxy collection install execution to trusted, reviewed requirements.yml files and internal mirrors
  • Audit existing CI/CD pipelines for collection sources sourced from user input, pull request contents, or external contributors

Patch Information

Red Hat has published tracking for the flaw under Red Hat Bug Report #2503724. The upstream fix mirrors the CVE-2026-11332 remediation by inserting the -- end-of-options separator into the git clone invocation in _extract_collection_from_git(). Apply vendor-provided packages for your platform once released and rebuild any execution environments or automation images that embed ansible-core.

Workarounds

  • Validate collection source URIs against an allowlist of schemes such as https:// and git@ before invoking ansible-galaxy, rejecting any value beginning with -
  • Host an internal collection mirror and configure ansible.cfg to disallow arbitrary external git sources
  • Run ansible-galaxy collection install inside an ephemeral, least-privileged container without access to credentials or production secrets

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.