CWE-428: Unquoted Search Path or Element
The product uses a search path that contains an unquoted element, in which the element contains whitespace or other separators. This can cause the product to access resources in a parent path.
Last updated
Overview
If a malicious individual has access to the file system, it is possible to elevate privileges by inserting such a file as "C:\Program.exe" to be run by a privileged program making use of WinExec.
Real-world CVEs
445 recorded CVEs are caused by CWE-428 (Unquoted Search Path or Element). The highest-severity and most recent are shown first. 206 new CWE-428 CVEs have been recorded so far in 2026 (50 in 2025).
- CVE-2023-38408Critical · CVSS 9.8 · EPSS 100th2023-07-20
- CVE-2022-36344Critical · CVSS 9.8 · EPSS 58th2022-08-16
- CVE-2020-14521Critical · CVSS 9.8 · EPSS 69th2022-02-11
- CVE-2020-9292Critical · CVSS 9.8 · EPSS 75th2020-06-04
- CVE-2019-17658Critical · CVSS 9.8 · EPSS 82th2020-03-12
- CVE-2019-8459Critical · CVSS 9.8 · EPSS 67th2019-06-20
- CVE-2025-8070
Windows service registered with an unquoted ImagePath vulnerability in the system registry
Critical · CVSS 9.2 · EPSS 6th2025-07-23 - CVE-2024-24722Critical · CVSS 9.1 · EPSS 48th2024-02-19
- CVE-2025-12507
Insecure service configuration – unquoted path
High · CVSS 8.8 · EPSS 3th2025-10-31 - CVE-2020-27645High · CVSS 8.8 · EPSS 69th2020-12-29
- CVE-2020-27644High · CVSS 8.8 · EPSS 67th2020-12-29
- CVE-2016-5793High · CVSS 8.8 · EPSS 30th2016-09-24
Showing 12 of 445 recorded CWE-428 CVEs. Get an alert for each new one, with AI-written analysis and fixes.
Monitor CWE-428 vulnerabilitiesCommon consequences
What can happen when CWE-428 is exploited.
Execute Unauthorized Code or Commands
Affects: Confidentiality, Integrity, Availability
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
Applies to
Operating systems
How to prevent it
Practical mitigations for CWE-428, grouped by where in the lifecycle they apply.
Properly quote the full search path before executing a program on the system.
Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.
Code examples
MITRE examples of the weakness in code.
The following example demonstrates the weakness.
Vulnerable example
UINT errCode = WinExec( "C:\\Program Files\\Foo\\Bar", SW_SHOW );Illustrative examples
Real CVEs that MITRE cites as examples of this weakness.
- CVE-2005-1185 — Small handful of others. Program doesn't quote the "C:\Program Files\" path when calling a program to be executed - or any other path with a directory or file whose name contains a space - so attacker can put a malicious program.exe into C:.
- CVE-2005-2938 — CreateProcess() and CreateProcessAsUser() can be misused by applications to allow "program.exe" style attacks in C:
- CVE-2000-1128 — Applies to "Common Files" folder, with a malicious common.exe, instead of "Program Files"/program.exe.
Terminology & mappings
Mapped taxonomies
- PLOVER: Unquoted Search Path or Element
Frequently asked questions
Common questions about CWE-428.
- What is CWE-428?
- The product uses a search path that contains an unquoted element, in which the element contains whitespace or other separators. This can cause the product to access resources in a parent path.
- What CVEs are caused by CWE-428?
- 445 recorded CVEs are attributed to CWE-428, including CVE-2023-38408, CVE-2022-36344, CVE-2020-14521.
- How do you prevent CWE-428?
- Properly quote the full search path before executing a program on the system.
- What are the consequences of CWE-428?
- Exploiting CWE-428 can lead to: Execute Unauthorized Code or Commands.
- Is CWE-428 actively exploited?
- 445 recorded CVEs are caused by CWE-428; none are currently in CISA's KEV catalog of actively exploited flaws.
References
- MITRE CWE definition (CWE-428) (opens in a new tab)
- CWE-428 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.
Track CWE-428 CVEs
Get an alert when a new CWE-428 CVE affects your products, with AI-written analysis and remediation steps.