Skip to content
OpenAdvisories

Weakness (CWE)

CWE-426: Untrusted Search Path

Base

The product searches for critical resources using an externally-supplied search path that can point to resources that are not under the product's direct control.

More detail

Some of the most common variants of untrusted search path are:

- In various UNIX and Linux-based systems, the PATH environment variable may be consulted to locate executable programs, and LD_PRELOAD may be used to locate a separate library. Programming languages may have their own paths for locating code, e.g. PERL5LIB in Perl.

- In various Microsoft-based systems, the PATH environment variable is consulted to locate a DLL, if the DLL is not found in other paths that appear earlier in the search order.

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.

  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 it, while execl() and execv() require a full path.

Source: MITRE CWE-426

260 results · Clear filters · Feed

  • High 8.2

    DLL side loading vulnerability in MA for Windows

    A DLL sideloading vulnerability in McAfee Agent for Windows prior to 5.7.4 could allow a local user to perform a DLL sideloading attack with an unsigned DLL with a specific name and in a specific location. This would result in the user gaining elevated permis…

  • High 7.3

    Untrusted Search Path in Nextcloud Desktop Client

    The Nextcloud Desktop Client is a tool to synchronize files from Nextcloud Server with a computer. The Nextcloud Desktop Client invokes its uninstaller script when being installed to make sure there are no remnants of previous installations. In versions 3.0.3…

  • High 7.8

    CA eHealth Performance Manager through 6.3.2.12 is affected by Privilege Escalation via a Dynamically Linked Shared Obj…

  • High 7.2

    Git LFS can execute a Git binary from the current directory on Windows

    Git LFS is a command line extension for managing large files with Git. On Windows, if Git LFS operates on a malicious repository with a git.bat or git.exe file in the current directory, that program would be executed, permitting the attacker to execute arbitr…

  • High 7.8

    A DLL search path vulnerability was reported in Lenovo Diagnostics prior to version 4.35.4 that could allow a user with…

  • High 7.8

    DLL Hijacking

    A DLL Hijacking vulnerability in Eaton's 9000x Programming and Configuration Software v 2.0.38 and prior allows an attacker to execute arbitrary code by replacing the required DLLs with malicious DLLs when the software try to load vci11un6.DLL and cinpl.DLL.

  • High 7.3

    A DLL search path vulnerability was reported in Lenovo Drivers Management prior to version 2.7.1128.1046 that could all…

  • High 7.8

    Adobe ColdFusion 2016 update 15 and earlier versions, and ColdFusion 2018 update 9 and earlier versions have a dll sear…

  • High 7.8

    Adobe ColdFusion 2016 update 15 and earlier versions, and ColdFusion 2018 update 9 and earlier versions have a dll sear…

  • High 7.5

    A untrusted search path vulnerability in Fortinet may allow attacker to execute unauthorized code or commands via netwo…

  • High 7.1

    A untrusted search path vulnerability in Fortinet may allow attacker to execute unauthorized code or commands via netwo…

  • High 8.6

    A untrusted search path vulnerability in Fortinet may allow attacker to execute unauthorized code or commands via netwo…

  • High 8.8

    It was found that glusterfs server does not properly sanitize file paths in the "trusted.io-stats-dump" extended attrib…

  • High 7.8

    Ansible Arbitrary Code Execution

    A flaw was found in ansible. ansible.cfg is read from the current working directory which can be altered to make it point to a plugin or a module path under the control of an attacker, thus allowing the attacker to execute arbitrary code.

  • High 7.8

    Ansible Improper Input Validation vulnerability

    In ansible it was found that inventory variables are loaded from current working directory when running ad-hoc command which are under attacker's control, allowing to run arbitrary code as a result.

  • High 7.8

    Ruby-ffi has a DLL loading issue

    ruby-ffi version 1.9.23 and earlier has a DLL loading issue which can be hijacked on Windows OS, when a Symbol is used as DLL name instead of a String This vulnerability appears to have been fixed in v1.9.24 and later.

  • High 7.3
    CVE-2016-10009 Public exploit EPSS 37%

    Untrusted search path vulnerability in ssh-agent.c in ssh-agent in OpenSSH before 7.4 allows remote attackers to execut…

  • High 7.8

    High severity vulnerability that affects electron

    Untrusted search path vulnerability in Atom Electron before 0.33.5 allows local users to gain privileges via a Trojan horse Node.js module in a parent directory of a directory named on a require line.

  • High 7.8
    CVE-2012-1854 Exploited EPSS 21%

    Untrusted search path vulnerability in VBE6.dll in Microsoft Office 2003 SP3, 2007 SP2 and SP3, and 2010 Gold and SP1; …

    KEV Apr 13, 2026
  • High 7.8

    Untrusted search path vulnerability in the Microsoft Foundation Class (MFC) Library in Microsoft Visual Studio .NET 200…