CVE-2021-31607 — salt
HIGHCVE-2021-31607 is a high-severity (CVSS 7.8) OS Command Injection vulnerability in salt. 1 public exploit or proof-of-concept reference is indexed, so weaponization risk is real. A fix is available for salt — see the affected versions and patch details below.
Command Injection in SaltStack Salt
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
saltReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
In SaltStack Salt 2016.9 through 3002.6, a command injection vulnerability exists in the snapper module that allows for local privilege escalation on a minion. The attack requires that a file is created with a pathname that is backed up by snapper, and that the master calls the snapper.diff function (which executes popen unsafely).
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | salt | ≥ 2016.11.0&&< 3003rc1 | 3003rc1pip install --upgrade 'salt==3003rc1' |
Affected Products
fedorafedoraprojectsaltsaltstackResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for salt, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update salt to 3003rc1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-31607 is resolved across your whole dependency graph.
Workarounds
Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.
Frequently Asked Questions
Is CVE-2021-31607 in your dependencies?
Find it across PyPI, including transitive dependencies.