Skip to content
RCE Write-up Intermediate

CVE-2026-11332: How I found an Argument Injection in Ansible, lea

Ansible-galaxy passed the user-supplied src value from requirements.yml or a role's meta/main.yml directly into the git clone command without validation, so a src starting with a hyphen was treated as a git option. An attacker could set core.sshCommand to run arbitrary commands on the Ansible controller when a victim installed a malicious role or requirements file.

Tommaso Bona Follow

Published on medium.com

Ansible, Red Hat’s open source IT automation platform, is one of the most widely deployed tools in enterprise infrastructure management. With hundreds of millions of downloads on PyPI, and adoption by virtually every major organization that runs Linux infrastructure at scale, Ansible is the backbone of how thousands…

Tommaso Bona, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The src value from requirements.yml or a role's meta/main.yml was appended to the git clone argument list without validation or an argument terminator, so a value beginning with a hyphen was parsed by git as an option such as -c core.sshCommand.

Impact

An attacker could execute arbitrary code on the Ansible controller, potentially exposing SSH keys, vault passwords and CI tokens, and this could be triggered by installing a malicious role or requirements file.

What the attacker needed

Victim runs ansible-galaxy role install; malicious role or requirements.yml is used

The fix

The fix should insert an argument terminator (--) before the user-supplied src and name, and optionally validate that src is a well-formed URL; patched versions were announced but not yet released at the time of writing.

How it was found

  1. Create a requirements.yml entry whose src begins with a hyphen and sets core.sshCommand to a command.
  2. Run ansible-galaxy role install -r requirements.yml.
  3. Observe that the injected command runs and writes its output to a marker file before the clone fails.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Ansible is a tool that automates setting up and managing servers. It can download 'roles' (pre-packaged automation) from the internet, and it uses the git program to do so. The bug is that a value from the role file was handed to git as if it were a command-line option, so an attacker could make git run their own command on the victim's machine.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Tommaso Bona

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.