Skip to content
RCE Write-up Advanced

A-Salt: attacking SaltStack

The write-up describes common SaltStack misconfigurations, including automatic minion enrolment, secrets stored in world-readable state files, and a pillar directory placed inside file_roots, plus a Jinja template injection in reactor scripts. An attacker with a rogue minion could read secrets and inject into reactor data to make the master run commands on other minions.

Alex Hill Follow

Published on skylightcyber.com

SaltStack is an IT orchestration platform, similar to Puppet or Ansible. This blog post introduces a set of common misconfigurations we’ve encountered in the wild, as well as a novel template injection technique that can achieve remote code execution on a salt-master (or master-of-masters) server.

Alex Hill, on skylightcyber.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

Likely the master trusted minion-supplied event data inside Jinja templates and exposed its file_roots and pillar files to every minion, so untrusted input and secrets were both reachable.

Impact

An attacker with a rogue minion could read exposed secrets and, where reactor templates use minion data, cause the master to run commands on any enrolled minion, potentially pivoting to master-of-masters and other customers.

What the attacker needed

Network access to master ports; ability to run a rogue minion; auto enrolment enabled; reactor uses minion data in template

The fix

Admins should require manual key acceptance, keep secrets in a pillar directory outside file_roots, and avoid placing untrusted minion data directly into Jinja templates.

How it was found

  1. Set up port forwarding so a rogue VM can reach the target master.
  2. Install a salt-minion on the rogue VM and point it at the target master.
  3. Rely on the autoaccept reactor to have the rogue minion's key accepted.
  4. List and pull down files from the master's file_roots to find secrets.
  5. Send a crafted event to the reactor tag with injected content in the product field.
  6. Observe the master render the injected YAML and issue a command to another minion.

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.

Salt is a tool that lets one central computer (the master) manage many other computers (minions). The report shows that if the master is set up carelessly, anyone who can join as a fake minion can read secrets or slip extra instructions into a template the master fills in, so the master ends up running the attacker's commands on other machines.

What is RCE?

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

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.