194 vulnerabilities classified as CWE-426 (不可信的搜索路径). AI Chinese analysis included.
CWE-426 represents a critical input validation weakness where software relies on an externally-supplied search path to locate essential resources, such as executables or configuration files, rather than using absolute paths or trusted directories. Attackers typically exploit this vulnerability by manipulating the environment variable or system path to point to malicious code placed in a directory with higher precedence than the legitimate resource location. This allows them to execute arbitrary programs, access unauthorized data, or alter configurations unexpectedly, effectively achieving privilege escalation or remote code execution. To prevent this, developers must enforce strict path validation, utilize absolute paths for critical resources, and implement secure coding practices that restrict search directories to trusted, controlled locations. Additionally, applying the principle of least privilege ensures that even if an attacker manipulates the path, they cannot execute harmful code due to insufficient permissions.
#define DIR "/restricted/directory" char cmd[500]; sprintf(cmd, "ls -l %480s", DIR); /* Raise privileges to those needed for accessing DIR. */ RaisePrivileges(...); system(cmd); DropPrivileges(...); ...The user sets the PATH to reference a directory under the attacker's control, such as "/my/dir/". The attacker creates a malicious program called "ls", and puts that program in /my/dir The user executes the program. When system() is executed, the shell consults the PATH to find the ls program The program finds the attacker's malicious program, "/my/dir/ls". It doesn't find "/bin/ls" because PATH does not contain "/bin/". The program executes the attacker's malicious program with the raised privileges.... String home = System.getProperty("APPHOME"); String cmd = home + INITCMD; java.lang.Runtime.getRuntime().exec(cmd); ...Vulnerabilities classified as CWE-426 (不可信的搜索路径) represent 194 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.