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 7.8
    CVE-2025-60749 Public exploit

    DLL Hijacking vulnerability in Trimble SketchUp desktop 2025 via crafted libcef.dll used by sketchup_webhelper.exe.

  • High 7.8

    The installer of WTW EAGLE (for Windows) 3.0.8.0 contains an issue with the DLL search path, which may lead to insecure…

  • High 8.4

    DLL hijacking vulnerability in Evope Collector 1.1.6.9.0 and related components load the wtsapi32.dll library from an u…

  • High 8.8

    Multiple DLL Search Order Hijacking Vulnerabilities in Docker Desktop Installer for Windows

    Docker Desktop Installer.exe is vulnerable to DLL hijacking due to insecure DLL search order. The installer searches for required DLLs in the user's Downloads folder before checking system directories, allowing local privilege escalation through malicious DLL…

  • High 7.0

    LibreWolf Installer setup.nsi uncontrolled search path

    A security vulnerability has been detected in LibreWolf up to 143.0.4-1 on Windows. This affects an unknown function of the file assets/setup.nsi of the component Installer. Such manipulation leads to uncontrolled search path. The attack must be carried out l…

  • High 7.8

    A potential DLL hijacking vulnerability was discovered in the Lenovo PC Manager during an internal security assessment …

  • High 7.8

    RemoteCall Remote Support Program (for Operator) versions prior to 5.3.0 contain an uncontrolled search path element vu…

  • High 7.8

    RemoteCall Remote Support Program (for Operator) versions prior to 5.1.0 contain an uncontrolled search path element vu…

  • High 7.8

    RemoteView PC Application Console versions prior to 6.0.2 contain an uncontrolled search path element vulnerability. If…

  • High 8.6

    Improper authentication of library files in the Eaton IPP software installer could lead to arbitrary code execution of …

  • High 8.2

    NVIDIA Display Driver contains a vulnerability where an uncontrolled DLL loading path might lead to arbitrary denial of…

  • High 8.8

    Privilege Escalation in Windows License plugin for Checkmk Windows Agent

    Use of an insecure temporary directory in the Windows License plugin for the Checkmk Windows Agent allows Privilege Escalation. This issue affects Checkmk: from 2.4.0 before 2.4.0p13, from 2.3.0 before 2.3.0p38, from 2.2.0 before 2.2.0p46, and all versions of…

  • High 7.8

    The installers of DENSO TEN drive recorder viewer contain an issue with the DLL search path, which may lead to insecure…

  • High 7.3
    CVE-2025-27237 Public exploit

    DLL injection in Zabbix Agent and Agent 2 via OpenSSL configuration

    In Zabbix Agent and Agent 2 on Windows, the OpenSSL configuration file is loaded from a path writable by low-privileged users, allowing malicious modification and potential local privilege escalation by injecting a DLL.

  • High 7.8

    Installer of Panasonic AutoDownloader version 1.2.8 contains an issue with the DLL search path, which may lead to loadi…

  • High 8.8

    DigiSign DigiSigner ONE 1.0.4.60 allows DLL Hijacking.

  • High 7.3

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

  • High 7.0
    CVE-2025-9267 Public exploit

    In Seagate Toolkit on Windows a vulnerability exists in the Toolkit Installer prior to versions 2.35.0.6 where it attem…

  • High 8.4
    CVE-2025-56383 Public exploit

    Notepad++ v8.8.3 has a DLL hijacking vulnerability, which can replace the original DLL file to execute malicious code. …

  • High 8.8

    Uncontrolled Search Path Element vulnerability in Salesforce Salesforce CLI on Windows allows Replace Trusted Executabl…

  • High 7.0

    Asterisk Unsafe Shell Sourcing in safe_asterisk Leads to Local Privilege Escalation

    A local privilege escalation vulnerability exists in the safe_asterisk script included with the Asterisk toolkit package. When Asterisk is started via this script (common in SysV init or FreePBX environments), it sources all .sh files located in /etc/asterisk…

  • High 7.8

    A DLL hijacking vulnerability in CYRISMA Agent before 444 allows local users to escalate privileges and execute arbitra…

  • High 7.8

    A potential DLL hijacking vulnerability was discovered in Lenovo Browser during an internal security assessment that co…

  • High 8.8

    Elevation of Privileges Vulnerability in IT Management Suite

    The Altiris Core Agent Updater package (AeXNSC.exe) is prone to an elevation of privileges vulnerability through DLL hijacking.

  • High 7.0

    DLL search path hijacking vulnerability

    DLL search path hijacking vulnerability in the UPDF.exe executable for Windows version 1.8.5.0 allows attackers with local access to execute arbitrary code by placing a FREngine.dll file of their choice in the 'C:\Users\Public\AppData\Local\UPDF\FREngine\Bin6…

  • High 7.0

    DLL search path hijacking vulnerability

    DLL search path hijacking vulnerability in the UPDF.exe executable for Windows version 1.8.5.0 allows attackers with local access to execute arbitrary code by placing a FREngine.dll file of their choice in the 'C:\Users\<user>\AppData\Local\UPDF\FREngine\Bin6…

  • High 7.0

    DLL search path hijacking vulnerability

    DLL search path hijacking vulnerability in the UPDF.exe executable for Windows version 1.8.5.0 allows attackers with local access to execute arbitrary code by placing a dxtn.dll file of their choice in the 'C:\Users\<user>\AppData\Local\Microsoft\WindowsApps\…

  • High 7.0

    DLL search order hijack in Wave by Grandstream Networks

    DLL search order hijacking vulnerability in the wave.exe executable for Windows 11, version 1.27.8. Exploitation of this vulnerability could allow attackers with local access to execute arbitrary code by placing an arbitrary file in the 'C:\Users<user>\AppDat…

  • High 7.8

    LizardBytes Sunshine for Windows contains a DLL search-order hijacking vulnerability

    Sunshine for Windows, version v2025.122.141614, contains a DLL search-order hijacking vulnerability, allowing attackers to insert a malicious DLL in user-writeable PATH directories.

  • High 7.8

    TkEasyGUI Affected by Uncontrolled Search Path Element Issue

    Uncontrolled search path element issue exists in TkEasyGUI versions prior to v1.0.22. If this vulnerability is exploited, arbitrary code may be executed with the privilege of running the program.

  • High 7.8

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

    Foxit PDF Reader Update Service Uncontrolled Search Path Element Local Privilege Escalation Vulnerability. This vulnerability allows local attackers to escalate privileges on affected installations of Foxit PDF Reader. An attacker must first obtain the abilit…

  • 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.0

    Mechrevo Control Center GX V2 Powershell Script Command uncontrolled search path

    A vulnerability has been found in Mechrevo Control Center GX V2 5.56.51.48. Affected is an unknown function of the file C:\Program Files\OEM\机械革命控制中心\AiStoneService\MyControlCenter\Command of the component Powershell Script Handler. Such manipulation leads to…

  • High 7.0

    Mechrevo Control Center GX V2 reg File uncontrolled search path

    A vulnerability was detected in Mechrevo Control Center GX V2 5.56.51.48. Impacted is an unknown function of the component reg File Handler. The manipulation results in uncontrolled search path. The attack needs to be approached locally. The attack requires a…

  • High 7.8

    Substance3D - Modeler | Uncontrolled Search Path Element (CWE-427)

    Substance3D - Modeler versions 1.22.0 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. If the application uses an uncontrolled search path to locate…

  • High 7.8

    The affected setup component is vulnerable to DLL hijacking. This could allow an attacker to execute arbitrary code whe…

  • High 7.7

    Paramount Macrium Reflect through 2025-06-26 allows attackers to execute arbitrary code with administrator privileges v…

  • High 7.7

    Paramount Macrium Reflect through 2025-06-26 allows local attackers to execute arbitrary code with administrator privil…

  • High 7.0

    Beats Uncontrolled Search Path Element can lead to Local Privilege Escalation (LPE) when using the Windows Installer

    An uncontrolled search path element vulnerability can lead to local privilege Escalation (LPE) via Insecure Directory Permissions. The vulnerability arises from improper handling of directory permissions. An attacker with local access may exploit this flaw to…

  • High 7.0

    APM Server Uncontrolled Search Path Element can lead to Local Privilege Escalation (LPE) when using the Windows Installer

    An uncontrolled search path element vulnerability can lead to local privilege Escalation (LPE) via Insecure Directory Permissions. The vulnerability arises from improper handling of directory permissions. An attacker with local access may exploit this flaw to…