CWE-426: Untrusted Search Path
650 CVEs have CWE-426 as their primary weakness. 2 of them are in the CISA KEV catalog. The highest EPSS score among them is 70.964%.
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.
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.
Child of CWE-642: External Control of Critical State Data
Mitigations
- 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.
- 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.
- 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.
- 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.
- 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.
Observed examples
- CVE-1999-1120: Application relies on its PATH environment variable to find and execute program.
- CVE-2008-1810: Database application relies on its PATH environment variable to find and execute program.
- CVE-2007-2027: Chain: untrusted search path enabling resultant format string by loading malicious internationalization messages.
- CVE-2008-3485: Untrusted search path using malicious .EXE in Windows environment.
- CVE-2008-2613: setuid program allows compromise using path that finds and loads a malicious library.
- CVE-2008-1319: Server allows client to specify the search path, which can be modified to point to a program that the client has uploaded.
Top released CVEs
KEV first, then the highest EPSS score, the highest CVSS score and the newest.
| CVE | Published | Severity | CVSS | EPSS | Description |
|---|---|---|---|---|---|
| CVE-2012-1854 | 2012-07-10 | HIGH | 7.8 | 20.867% | Untrusted search path vulnerability in VBE6.dll in Microsoft Office 2003 SP3, 2007 SP2 and SP3, and 2010 Gold and SP1; Microsoft Visual Basic for Applications… |
| CVE-2022-22047 | 2022-07-12 | HIGH | 7.8 | 18.264% | Windows Client Server Run-time Subsystem (CSRSS) Elevation of Privilege Vulnerability |
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cwe_lookup/CWE-426'curl 'https://api.contrastcyber.com/cve_search?cwe_id=CWE-426'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).