Miggo Logo

CVE-2025-22237: Salt's on demand pillar functionality vulnerable to arbitrary command injections

6.7

CVSS Score
3.1

Basic Information

EPSS Score
0.05716%
Published
6/13/2025
Updated
6/13/2025
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
saltpip>= 3006.0rc1, < 3006.123006.12
saltpip>= 3007.0rc1, < 3007.43007.4

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability (CVE-2025-22237) allows for arbitrary command injection on the Salt master via the 'on-demand' pillar functionality. An attacker with access to a minion key can send a specially crafted git URL to the master when pillar data is requested.

The root cause lies in the insufficient validation of these git URLs before they are processed.

  1. The salt.master.AESFuncs._pillar function is an entry point that receives pillar requests from minions. This request can include specifications for on-demand external pillars, such as those sourced from git repositories. This function takes the potentially malicious input (the crafted git URL) and passes it down for processing.
  2. The salt.utils.gitfs.GitFS.init_remotes function is responsible for setting up these git remotes. Prior to the patch (commit 9445f496fed61b15dc4364818007e5b765b0746f), this function did not adequately sanitize or validate the provided git URLs. A crafted URL could therefore inject commands that would be executed by the underlying git client or shell with the privileges of the Salt master process.

The patch introduces a URLValidator in salt/utils/verify.py and applies this validation within salt.utils.gitfs.GitFS.init_remotes to ensure that only legitimate and safe URLs are processed. Additionally, salt.pillar.Pillar.__valid_on_demand_ext_pillar was hardened to better control which external pillars can be loaded on demand. For a security engineer, this means that any Salt master running a vulnerable version and configured to use on-demand git pillars could be compromised if a minion key is exposed, allowing an attacker to execute arbitrary commands on the master.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*n *tt**k*r wit* ****ss to * minion k*y **n *xploit t** 'on **m*n*' pill*r *un*tion*lity wit* * sp**i*lly *r**t** *it url w*i** *oul* **us* *n* *r*itr*ry *omm*n* to ** run on t** m*st*r wit* t** s*m* privil***s *s t** m*st*r pro**ss.

Reasoning

T** vuln*r**ility (*V*-****-*****) *llows *or *r*itr*ry *omm*n* inj**tion on t** S*lt m*st*r vi* t** 'on-**m*n*' pill*r *un*tion*lity. *n *tt**k*r wit* ****ss to * minion k*y **n s*n* * sp**i*lly *r**t** *it URL to t** m*st*r w**n pill*r **t* is r*qu