CVE-2021-21996: Salt Remote Code Execution Vulnerability
HIGHCVE-2021-21996 is a HIGH (CVSS 7.5) remote code execution vulnerability (CWE-668: Exposure of Resource to Wrong Sphere) affecting Salt libraries in the PyPI ecosystem. The issue involves exposure of resource to wrong sphere in salt. Remediation is available by upgrading affected packages to version 3003.3.
CVE-2021-21996 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2021-21996
To remediate this vulnerability, upgrade all affected Salt dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install salt>=3003.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show salt
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2021-21996, inspect your installed packages using pip:
pip show salt
Analyze the terminal output to locate any version of Salt in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3003.3), your application is affected.
Note: The pip show salt command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-668: Exposure of Resource to Wrong Sphere, where the product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. In Salt, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-21996 Affected Salt Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
salt
|
PyPI |
< 3003.3
|
3003.3
|
References
Frequently Asked Questions
What is CVE-2021-21996?
Which Salt versions are affected?
What version fixes CVE-2021-21996?
Is salt affected?
What is the CVSS score of CVE-2021-21996?
What CWE is associated with CVE-2021-21996?
How can I check PyPI dependencies for CVE-2021-21996?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pf7h-h2wq-m7pg",
"modified" : "2024-10-22T14:57:24Z",
"published" : "2021-11-21T00:00:58Z",
"aliases" : [ "CVE-2021-21996" ],
"summary" : "Exposure of Resource to Wrong Sphere in salt",
"details" : "An issue was discovered in SaltStack Salt before 3003.3. A user who has control of the source, and source_hash URLs can gain full file system access as root on a salt minion.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "salt"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3003.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-21996"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/salt/PYSEC-2021-318.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/saltstack/salt"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2021/11/msg00017.html"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2021/11/msg00019.html"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6BUWUF5VTENNP2ZYZBVFKPSUHLKLUBD5"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ACVT7M4YLZRLWWQ6SGRK3C6TOF4FXOXT"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MBAHHSGZLEJRCG4DX6J4RBWJAAWH55RQ"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/6BUWUF5VTENNP2ZYZBVFKPSUHLKLUBD5"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ACVT7M4YLZRLWWQ6SGRK3C6TOF4FXOXT"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MBAHHSGZLEJRCG4DX6J4RBWJAAWH55RQ"
}, {
"type" : "WEB",
"url" : "https://saltproject.io/security_announcements/salt-security-advisory-2021-sep-02"
}, {
"type" : "WEB",
"url" : "https://security.gentoo.org/glsa/202310-22"
}, {
"type" : "WEB",
"url" : "https://www.debian.org/security/2021/dsa-5011"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-668" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-07-05T22:05:39Z",
"nvd_published_at" : "2021-09-08T15:15:00Z"
}
}