CVE Vulnerabilities


Uncontrolled Search Path Element

Published: Jul 09, 2018 | Modified: Sep 27, 2019
CVSS 3.x
CVSS 2.x

The Rust Programming Language rustdoc version Between 0.8 and 1.27.0 contains a CWE-427: Uncontrolled Search Path Element vulnerability in rustdoc plugins that can result in local code execution as a different user. This attack appear to be exploitable via using the –plugin flag without the –plugin-path flag. This vulnerability appears to have been fixed in 1.27.1.


The product uses a fixed or controlled search path to find resources, but one or more locations in that path can be under the control of unintended actors.

Affected Software

Name Vendor Start Version End Version
Rust Rust-lang 0.8 1.27.0
Red Hat Developer Tools RedHat rust-toolset-1.29-0:1.29.2-1.el7 *
Red Hat Developer Tools RedHat rust-toolset-1.29-cargo-vendor-0:0.1.17-1.el7 *
Red Hat Developer Tools RedHat rust-toolset-1.29-rust-0:1.29.2-1.el7 *
Rustc Ubuntu artful *
Rustc Ubuntu upstream *

Extended Description

Although this weakness can occur with any type of resource, it is frequently introduced when a product uses a directory search path to find executables or code libraries, but the path contains a directory that can be modified by an attacker, such as “/tmp” or the current working directory. In Windows-based systems, when the LoadLibrary or LoadLibraryEx function is called with a DLL name that does not contain a fully qualified path, the function follows a search order that includes two path elements that might be uncontrolled:

In some cases, the attack can be conducted remotely, such as when SMB or WebDAV network shares are used. In some Unix-based systems, a PATH might be created that contains an empty element, e.g. by splicing an empty variable into the PATH. This empty element can be interpreted as equivalent to the current working directory, which might be an untrusted search element. In software package management frameworks (e.g., npm, RubyGems, or PyPi), the framework may identify dependencies on third-party libraries or other packages, then consult a repository that contains the desired package. The framework may search a public repository before a private repository. This could be exploited by attackers by placing a malicious package in the public repository that has the same name as a package from the private repository. The search path might not be directly under control of the developer relying on the framework, but this search order effectively contains an untrusted element.

Potential Mitigations