CWE-426: Untrusted Search Path

low-risk

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.

Abstraction: Base

Common Consequences

Integrity Gain Privileges or Assume Identity
Availability DoS: Crash, Exit, or Restart
Confidentiality Read Files or Directories

Detection Methods

Black Box

Use monitoring tools that examine the software's process as it interacts with the operating system and the network. This technique is useful in cases when source code is unavailable, if the software was not developed by you, or if you want to verify that the build phase did not introduce any new weaknesses. Examples include debuggers that directly attach to the running process; system-call tracing utilities such as truss (Solaris) and strace (Linux); system activity monitors such as FileMon, RegMon, Process Monitor, and other Sysinternals utilities (Windows); and sniffers and protocol analyzers that monitor network traffic. Attach the monitor to the process and look for library functions and system calls that suggest when a search path is being used. One pattern is when the program performs multiple accesses of the same file but in different directories, with repeated failures until the proper filename is found. Library calls such as getenv() or their equivalent can be checked to see if any path-related variables are being accessed.

Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Manual Analysis

Use tools and techniques that require manual (human) analysis, such as penetration testing, threat modeling, and interactive tools that allow the tester to record and modify an active session. These may be more effective than strictly automated techniques. This is especially the case with weaknesses that are related to design and business rules.

Real-World Examples (10)

CVE CVSS EPSS KEV
CVE-2023-36003 6.7 38.6%
CVE-2019-11660 7.8 34.2%
CVE-2016-5330 7.8 25.5%
CVE-2024-13158 7.2 21.5%
CVE-2019-0809 7.8 17.0%
CVE-2024-6769 6.7 16.0%
CVE-2018-0598 7.8 13.9%
CVE-2018-16156 7.8 13.9%
CVE-2022-23748 7.8 11.7% Y
CVE-2024-50986 7.3 10.9%
3
/ 100
low-risk
Active Threat 2/50 · Minimal
Exploit Availability 1/50 · Minimal