CVE-2021-21996: Salt Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-pf7h-h2wq-m7pg
CVSS 7.5
CWE-668
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2021-21996
GHSA Identifier GHSA-pf7h-h2wq-m7pg
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-668: Exposure of Resource to Wrong Sphere
Affected Product Salt
Package Ecosystem PyPI
Published Date
Last Updated

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

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (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.

salt fixed: 3003.3
pip install salt>=3003.3
Verify Direct and Transitive Dependencies

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

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.

CVE-2021-21996 Affected Salt Versions

1 component(s)
Fixed Versions:
3003.3
Product / Package Ecosystem Affected Versions Fixed Version
salt
PyPI
< 3003.3
3003.3

References

NVD — CVE-2021-21996 NVD
https://nvd.nist.gov/vuln/detail/CVE-2021-21996
Salt Source Repository REPOSITORY
https://github.com/pypa/advisory-database/tree/main/vulns/salt/PYSEC-2021-318.yaml
Salt Source Repository REPOSITORY
https://github.com/saltstack/salt
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2021/11/msg00017.html
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2021/11/msg00019.html
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6BUWUF5VTENNP2ZYZBVFKPSUHLKLUBD5
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ACVT7M4YLZRLWWQ6SGRK3C6TOF4FXOXT
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MBAHHSGZLEJRCG4DX6J4RBWJAAWH55RQ
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/6BUWUF5VTENNP2ZYZBVFKPSUHLKLUBD5
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ACVT7M4YLZRLWWQ6SGRK3C6TOF4FXOXT
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MBAHHSGZLEJRCG4DX6J4RBWJAAWH55RQ
Salt Security Information SECURITY
https://saltproject.io/security_announcements/salt-security-advisory-2021-sep-02
Salt Security Information SECURITY
https://security.gentoo.org/glsa/202310-22
Salt Security Information SECURITY
https://www.debian.org/security/2021/dsa-5011

Frequently Asked Questions

What is CVE-2021-21996?
CVE-2021-21996 is a security vulnerability in Salt involving Exposure of Resource to Wrong Sphere in salt under CWE-668: Exposure of Resource to Wrong Sphere.
Which Salt versions are affected?
Affected versions include releases prior to 3003.3 across affected packages: salt.
What version fixes CVE-2021-21996?
Upgrading to 3003.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is salt affected?
Yes, salt is affected in releases prior to 3003.3. Upgrade your dependency to 3003.3 or later.
What is the CVSS score of CVE-2021-21996?
CVE-2021-21996 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2021-21996?
CVE-2021-21996 is classified under CWE-668: Exposure of Resource to Wrong Sphere (The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.).
How can I check PyPI dependencies for CVE-2021-21996?
Run the dependency tree command: 'pip show salt'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}