CVE-2017-12791: SaltStack Salt directory traversal in minion id validation

CVE-2017-12791 · Severity: critical · CVSS 9.8 · Published 2022-05-17

SaltStack Salt is an automation and configuration management platform used to manage large numbers of servers. A vulnerability in how the central 'master' server validates the identity of connecting 'minion' agents allows an attacker to bypass authentication. This could allow an unauthorized party to gain control over the management server, potentially leading to full system compromise or data theft across the managed infrastructure.

Technologies: salt (PyPI), Saltstack Salt. Vendors: PyPI, Saltstack.

Quick answers

Is CVE-2017-12791 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2017-12791 being exploited in the wild.
How severe is CVE-2017-12791?
Critical severity, with a CVSS score of 9.8, published 17 May 2022.
Which products and versions are affected?
salt (PyPI) ECOSYSTEM:introduced=0,fixed=2016.11.7, ECOSYSTEM:introduced=0,fixed=2016.11.7,introduced=2017.7,fixed=2017.7.1; Saltstack Salt < 2016.11.7, >= 2017.7.0, < 2017.7.1.
Is there a fix for CVE-2017-12791?
Yes. salt (PyPI): upgrade to 2016.11.7, 2017.7.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2017-12791 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2017-12791?
Check whether you run salt (PyPI) or Saltstack Salt at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • salt (PyPI): upgrade to 2016.11.7, 2017.7.1 or later
    pip install "salt>=2017.7.1"

Technical details

A directory traversal vulnerability exists in the minion ID validation logic of SaltStack Salt. By crafting a minion ID containing path traversal sequences (e.g., '../'), a remote attacker can bypass credential validation and successfully authenticate to a Salt master. This occurs because the software fails to properly neutralize special elements within the pathname used to identify the minion. An attacker can exploit this over the network without prior authentication or user interaction to gain unauthorized access to the master server. The issue was addressed by introducing a 'clean_id' validation function in salt.utils.verify.py.

Affected products

  • SaltStack Salt < 2016.11.7, >= 2017.7.0, < 2017.7.1

Identifiers

  • CVE-2017-12791
  • GHSA-xxvj-8g5m-4qgw
  • PYSEC-2017-151
  • PYSEC-2017-35

Timeline

  • 2017-08-15: patched: Fix merged into SaltStack repository
  • 2017-08-23: advisory: NVD published CVE-2017-12791
  • 2022-05-17: disclosed: GitHub Advisory published

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.