# CVE-2021-31607: Command Injection in SaltStack Salt

- Severity: High 7.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 5.92%, higher than 93% of CVEs (2026-12-02)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2021-04-23T00:00:00.000Z
- Modified: 2026-06-17T03:52:04.190Z
- Also known as: GHSA-hcjf-rp5h-g5h3, PYSEC-2021-56
- Weaknesses: CWE-77, CWE-78
- Assigned by: mitre

## 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).

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- salt (PyPI): from 2016.11.0 before 3003rc1
- saltstack salt: from 2016.9 up to 3002.6
- fedoraproject fedora: 33; 34; 35

## Every score

- GitHub: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 4.6 Medium `AV:L/AC:L/Au:N/C:P/I:P/A:P`

## References

- <https://sec.stealthcopter.com/saltstack-snapper-minion-privledge-escaltion/> (exploit, patch, third-party-advisory, web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LDKMAJXYFHM4USVX3H5V2GCCBGASWUSM/> (mailing-list, third-party-advisory, vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MBAHHSGZLEJRCG4DX6J4RBWJAAWH55RQ/> (mailing-list, third-party-advisory, vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ACVT7M4YLZRLWWQ6SGRK3C6TOF4FXOXT/> (mailing-list, third-party-advisory, vendor-advisory)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6BUWUF5VTENNP2ZYZBVFKPSUHLKLUBD5/> (mailing-list, third-party-advisory, vendor-advisory)
- <https://lists.debian.org/debian-lts-announce/2021/11/msg00009.html> (mailing-list, third-party-advisory, web)
- <https://www.debian.org/security/2021/dsa-5011> (third-party-advisory, vendor-advisory, web)
- <https://security.gentoo.org/glsa/202310-22> (third-party-advisory, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-31607> (advisory)
- <https://github.com/pypa/advisory-database/tree/main/vulns/salt/PYSEC-2021-56.yaml> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6BUWUF5VTENNP2ZYZBVFKPSUHLKLUBD5> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ACVT7M4YLZRLWWQ6SGRK3C6TOF4FXOXT> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LDKMAJXYFHM4USVX3H5V2GCCBGASWUSM> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MBAHHSGZLEJRCG4DX6J4RBWJAAWH55RQ> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/6BUWUF5VTENNP2ZYZBVFKPSUHLKLUBD5> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ACVT7M4YLZRLWWQ6SGRK3C6TOF4FXOXT> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LDKMAJXYFHM4USVX3H5V2GCCBGASWUSM> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MBAHHSGZLEJRCG4DX6J4RBWJAAWH55RQ> (web)
- <https://sec.stealthcopter.com/saltstack-snapper-minion-privledge-escaltion> (web)
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LDKMAJXYFHM4USVX3H5V2GCCBGASWUSM/> (web)
- <https://github.com/advisories/GHSA-hcjf-rp5h-g5h3> (advisory)

## Sources

- CVE List: [CVE-2021-31607](https://www.cve.org/CVERecord?id=CVE-2021-31607), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-hcjf-rp5h-g5h3](https://github.com/advisories/GHSA-hcjf-rp5h-g5h3), CC-BY-4.0, modified 2024-10-23
- NVD: [CVE-2021-31607](https://nvd.nist.gov/vuln/detail/CVE-2021-31607), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2021-56](https://osv.dev/vulnerability/PYSEC-2021-56), CC-BY-4.0, modified 2023-11-08

---

Page: https://cve.day/CVE-2021-31607 · Whole record: https://cve.day/CVE-2021-31607.json · Rebuilt by cve.day 2026-11-25T22:58:01.012Z
