CVE-2024-22231: Salt Directory Creation By Malicious User Vulnerability

MODERATE
Advisory Identifier: GHSA-q27c-j6j9-53w3
CVSS 5.0
CWE-22
Published
Advisory Summary

CVE-2024-22231 is a MODERATE (CVSS 5.0) directory creation by malicious user vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Salt libraries in the PyPI ecosystem. The issue involves directory creation by malicious user in saltstack. Remediation is available by upgrading affected packages to version 3005.5, 3006.6.

CVE-2024-22231 at a Glance

CVE Identifier CVE-2024-22231
GHSA Identifier GHSA-q27c-j6j9-53w3
Severity MODERATE
CVSS v3.1 Base Score 5.0
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Salt
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2024-22231

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: 3005.5
pip install salt>=3005.5
salt fixed: 3006.6
pip install salt>=3006.6
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-2024-22231, 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 3005.5), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. 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

Syndic cache directory creation is vulnerable to a directory traversal attack in salt project which can lead a malicious attacker to create an arbitrary directory on a Salt master.

CVE-2024-22231 Affected Salt Versions

2 component(s)
Fixed Versions:
3005.53006.6
Product / Package Ecosystem Affected Versions Fixed Version
salt
PyPI
< 3005.5
3005.5
salt
PyPI
≥ 3006.0
< 3006.6
3006.6

References

Frequently Asked Questions

What is CVE-2024-22231?
CVE-2024-22231 is a security vulnerability in Salt involving Directory creation by malicious user in saltstack under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Salt versions are affected?
Affected versions include releases prior to 3005.5, 3006.6 across affected packages: salt.
What version fixes CVE-2024-22231?
Upgrading to 3005.5, 3006.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is salt affected?
Yes, salt is affected in releases prior to 3005.5, 3006.6. Upgrade your dependency to 3005.5, 3006.6 or later.
What is the CVSS score of CVE-2024-22231?
CVE-2024-22231 has a CVSS v3.1 base score of 5.0 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:N.
What CWE is associated with CVE-2024-22231?
CVE-2024-22231 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check PyPI dependencies for CVE-2024-22231?
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-q27c-j6j9-53w3",
  "modified" : "2024-06-27T17:47:29Z",
  "published" : "2024-06-27T09:30:39Z",
  "aliases" : [ "CVE-2024-22231" ],
  "summary" : "Directory creation by malicious user in saltstack",
  "details" : "Syndic cache directory creation is vulnerable to a directory traversal attack in salt project which can lead a malicious attacker to create an arbitrary directory on a Salt master.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "salt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3005.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "salt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3006.0"
      }, {
        "fixed" : "3006.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-22231"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/saltstack/salt/commit/e0cdb80b55123f4a024759ffcf2b3f0e0788e7ab"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/saltstack/salt"
  }, {
    "type" : "WEB",
    "url" : "https://saltproject.io/security-announcements/2024-01-31-advisory"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-27T17:47:29Z",
    "nvd_published_at" : "2024-06-27T07:15:52Z"
  }
}