Skip to content
OpenAdvisories

Weakness (CWE)

CWE-427: Uncontrolled Search Path Element

Base Draft

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.

More detail

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:

- the directory from which the program has been loaded

- the current working directory

In some cases, the attack can be conducted remotely, such as when SMB or WebDAV network shares are used.

One or more locations in that path could include the Windows drive root or its subdirectories. This often exists in Linux-based code assuming the controlled nature of the root directory (/) or its subdirectories (/etc, etc), or a code that recursively accesses the parent directory. In Windows, the drive root and some of its subdirectories have weak permissions by default, which makes them uncontrolled.

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.

How to prevent it (5 mitigations)
  1. Architecture and Design, Implementation

    Hard-code the search path to a set of known-safe values (such as system directories), or only allow them to be specified by the administrator in a configuration file. Do not allow these settings to be modified by an external party. Be careful to avoid related weaknesses such as CWE-426 and CWE-428.

  2. Implementation

    When invoking other programs, specify those programs using fully-qualified pathnames. While this is an effective approach, code that uses fully-qualified pathnames might not be portable to other systems that do not use the same pathnames. The portability can be improved by locating the full-qualified paths in a centralized, easily-modifiable location within the source code, and having the code refer to these paths.

  3. Implementation

    Remove or restrict all environment settings before invoking other programs. This includes the PATH environment variable, LD_LIBRARY_PATH, and other settings that identify the location of code libraries, and any application-specific search paths.

  4. Implementation

    Check your search path before use and remove any elements that are likely to be unsafe, such as the current working directory or a temporary files directory. Since this is a denylist approach, it might not be a complete solution.

  5. Implementation

    Use other functions that require explicit paths. Making use of any of the other readily available functions that require explicit paths is a safe way to avoid this problem. For example, system() in C does not require a full path since the shell can take care of finding the program using the PATH environment variable, while execl() and execv() require a full path.

Source: MITRE CWE-427

545 results · Clear filters · Feed

  • High 8.8

    IBM i is Affected by Privilege Escalation []

    IBM i 7.6, 7.5, 7.4, and 7.3 could allow a user to gain elevated privileges due to an unqualified library call. A malicious actor could cause user-controlled code to run with administrator privilege.

    IBM i
  • High 7.8

    Local Privilege Escalation vulnerability in Check Point Identity Agent Full for Windows OS

    A local privilege escalation vulnerability exists in Check Point Identity Agent Full for Windows OS. An authenticated local user may be able to execute arbitrary code with SYSTEM privileges due to improper handling of executable resolution during the log coll…

  • High 7.8

    A potential uncontrolled search path vulnerability was reported in the LanSchool Classic client application that could …

  • High 7.7

    Acrobat Reader | Uncontrolled Search Path Element (CWE-427)

    Acrobat Reader versions 24.001.30365, 26.001.21651 and earlier are affected by an Uncontrolled Search Path Element vulnerability that could result in arbitrary code execution in the context of the current user. An attacker with high privileges could exploit t…

  • High 7.2
    CVE-2026-41567 Public exploit

    Docker: `PUT /containers/{id}/archive` executes container binary on the host

    Moby is an open source container framework. In versions prior to 29.5.1 and in moby/moby v2 prior to v2.0.0-beta.14, when a compressed archive is uploaded to a container via `PUT /containers/{id}/archive` or piped through `docker cp -`, the daemon resolves de…

  • High 7.3

    Local privilege escalation due to DLL hijacking vulnerability. The following products are affected: Acronis DeviceLock …

  • High 7.3

    Local privilege escalation due to DLL hijacking vulnerability. The following products are affected: Acronis DeviceLock …

  • High 7.3

    Local privilege escalation due to EXE hijacking vulnerability. The following products are affected: Acronis DeviceLock …

  • High 7.8

    A DLL hijacking vulnerability in Wassimulator (GitHub) CactusViewer v2.3.0 allows attackers to escalate privileges and …

  • High 8.2

    Espressif Shared GitHub DangerJS: Untrusted Search Path in DangerJS Action Entrypoint

    Espressif Shared GitHub DangerJS is a reusable GitHub Action CI DangerJS workflow for Espressif GitHub projects. Prior to 1.0.1, the action's entrypoint.sh invoked DangerJS from the caller's workspace after copying the fork's checkout into it, creating an unt…

  • High 7.8

    Uncontrolled search path element vulnerability in OpenSSL DLL component in Synology BeeDrive for desktop before 1.3.2-1…

  • High 7.8

    Untrusted Search Path

    A local user with low privileges may be able to influence the behavior of a privileged system service by manipulating configuration or application-related files located in user-writable areas of the filesystem. The affected service processes data from locatio…

  • High 7.3

    Mullvad VPN for macOS: Local Privilege Escalation via unverified bundle path in installer

    Mullvad VPN is a VPN client app for desktop and mobile. When using macOS with versions 2026.1 and below, Mullvad VPN may allow local privilege escalation during installation or upgrade. The installer package executes binaries from /Applications/Mullvad VPN.ap…

  • High 7.8

    Claude HUD 0.0.12 Arbitrary Command Execution via COMSPEC Environment Variable

    Claude HUD through 0.0.12, patched in commit 234d9aa, contains a command injection vulnerability that allows local attackers to execute arbitrary commands by manipulating the COMSPEC environment variable. Attackers can set COMSPEC to an arbitrary binary path …

  • High 7.0

    A DLL hijacking vulnerability in the AMD Cleanup Utility could allow an attacker to achieve privilege escalation potent…

  • High 8.5

    Metasploit Pro on Windows: Local Privilege Escalation via OpenSSL Configuration File Loading

    Rapid7 Metasploit Pro is vulnerable to a local privilege escalation attack that allows a user to gain SYSTEM level control of a Windows host. When started the metasploitPostgreSQL service would start the postgres.exe child process which would in turn load an …

  • High 7.0

    Unsafe OpenSSL initialization within some AMD optional tools may allow a local user-privileged attacker to inject a mal…

  • High 7.8

    Bytello Share (Windows Edition) installer executable provided by Bytello insecurely loads Dynamic Link Libraries. If th…

  • High 7.8

    OpenClaw < 2026.4.23 - Arbitrary Code Execution via setup-api.js in Current Working Directory

    OpenClaw before 2026.4.23 contains an arbitrary code execution vulnerability in the bundled plugin setup resolver that loads setup-api.js from process.cwd() during provider setup metadata resolution. Attackers can execute arbitrary JavaScript under the curren…

  • High 7.3

    OpenClaw < 2026.4.20 - Arbitrary Code Execution via MCP stdio Environment Variables

    OpenClaw before 2026.4.20 contains an improper environment variable validation vulnerability in MCP stdio server configuration that allows attackers to execute arbitrary code. Malicious workspace configurations can pass dangerous startup variables like NODE_O…

  • High 8.4

    AC2000 Uncontrolled Search Path Element

    An Uncontrolled Search Path Element vulnerability in JohnsonControls AC2000 on Windows allows Leveraging/Manipulating Configuration File Search Paths. This issue affects AC2000: from 10.6 before release 10, from 11.0 before release 9, from 12 before release 3.

  • High 8.5

    Uncontrolled search path in PluginLauncher allows SYSTEM code execution in WatchGuard Agent

    Uncontrolled Search Path Element vulnerability in WatchGuard Agent on Windows allows Using Malicious Files.

  • High 7.8

    eMPIA Technology|AVACAST - DLL Hijacking

    AVACAST developed by eMPIA Technology, has a DLL Hijacking vulnerability, allowing authenticated local attackers to place a malicious DLL in a specific directory, resulting in arbitrary code execution with system privileges when the system loads the DLL.

  • High 7.8

    NSIS (Nullsoft Scriptable Install System) 3.06.1 before 3.12 sometimes uses the Low IL temp directory when executing as…

  • High 8.0

    Microsoft Power Apps Remote Code Execution Vulnerability

    Uncontrolled search path element in Microsoft Power Apps allows an unauthorized attacker to execute code over a network.

  • High 7.3

    IP Setting Software contains an issue with the DLL search path, which may lead to insecurely loading Dynamic Link Libra…

  • High 7.8

    The installers of LiveOn Meet Client for Windows (Downloader5Installer.exe and Downloader5InstallerForAdmin.exe) and th…

  • High 7.0
    CVE-2026-6421 Public exploit

    Mobatek MobaXterm Home Edition msimg32.dll uncontrolled search path

    A vulnerability has been found in Mobatek MobaXterm Home Edition up to 26.1. This affects an unknown part in the library msimg32.dll. The manipulation leads to uncontrolled search path. An attack has to be approached locally. The attack is considered to have …

  • High 7.8

    Eaton Intelligent Power Protector (IPP) is affected by insecure library loading in its executable, which could lead to …

  • High 8.6

    Photoshop Installer | CWE-427: Uncontrolled Search Path Element

    Adobe Photoshop Installer was affected by an Uncontrolled Search Path Element vulnerability that could have resulted in arbitrary code execution in the context of the current user. An attacker could have exploited this vulnerability by placing a malicious lib…

  • High 7.3

    During an internal security assessment, a potential vulnerability was discovered in Lenovo Software Fix, that during in…

  • High 7.8

    Vulnerability Related to an Uncontrolled Search Path Element in a UPS Management Application

    It has been identified that a vulnerability (CWE-427) exists in the UPS (Uninterruptible Power Supply) management application, whereby improper permissions on the installation directory allow a malicious actor to place a DLL that is then executed with adminis…

  • High 7.3

    KeePassXC OpenSSL Configuration Uncontrolled Search Path Element Local Privilege Escalation Vulnerability

    KeePassXC OpenSSL Configuration Uncontrolled Search Path Element Local Privilege Escalation Vulnerability. This vulnerability allows local attackers to escalate privileges on affected installations of KeePassXC. An attacker must first obtain the ability to ex…

  • High 7.8

    NoMachine Uncontrolled Search Path Element Local Privilege Escalation Vulnerability

    NoMachine Uncontrolled Search Path Element Local Privilege Escalation Vulnerability. This vulnerability allows local attackers to escalate privileges on affected installations of NoMachine. An attacker must first obtain the ability to execute low-privileged c…

  • High 7.8

    Emocheck insecurely loads Dynamic Link Libraries (DLLs). If a crafted DLL file is placed to the same directory, an arbi…

  • High 8.8

    A Dynamic-link Library Injection vulnerability in GatewayGeo MapServer for Windows version 5 allows attackers to escala…

  • High 7.8

    MemProcFS < 5.17 DLL/Shared Library Hijacking

    MemProcFS before 5.17 contains multiple unsafe library-loading patterns that enable DLL and shared-library hijacking across six attack surfaces, including bare-name LoadLibraryU and dlopen calls without path qualification for vmmpyc, libMSCompression, and plu…

  • High 7.8

    Libssh: libssh: insecure default configuration leads to local man-in-the-middle attacks on windows

    A flaw was found in libssh. This vulnerability allows local man-in-the-middle attacks, security downgrades of SSH (Secure Shell) connections, and manipulation of trusted host information, posing a significant risk to the confidentiality, integrity, and availa…

  • High 7.8

    Foxit PDF Editor/Reader Update Service Uncontrolled Search Path Element Local Privilege Escalation Vulnerability

    The application's update service, when checking for updates, loads certain system libraries from a search path that includes directories writable by low‑privileged users and is not strictly restricted to trusted system locations. Because these libraries may b…

  • High 7.8

    openssl on Windows built with openssldir set from the build machine (Uncontrolled Search Path Element)

    vcpkg is a free and open-source C/C++ package manager. Prior to version 3.6.1#3, vcpkg's Windows builds of OpenSSL set openssldir to a path on the build machine, making that path be attackable later on customer machines. This issue has been patched in version…