---
title: "CWE-428: Unquoted Search Path or Element"
url: https://radicalnotion.ai/cwe/cwe-428
type: cwe
description: "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."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-428: Unquoted Search Path or Element

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 454
- **Of those, in CISA KEV:** 0
- **New in 2026:** 210
- **CWE catalog version:** 4.21

## Description

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.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Applicable platforms

**Operating systems:** Windows NT (Sometimes), macOS (Rarely)

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality, Integrity, Availability | Execute Unauthorized Code or Commands | 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. |

## Potential mitigations

### Implementation

Properly quote the full search path before executing a program on the system.

### Implementation (Input Validation)

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.

### Implementation (Input Validation)

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.

## Demonstrative examples

### Example 1

The following example demonstrates the weakness.

Bad code:

```c
UINT errCode = WinExec( "C:\\Program Files\\Foo\\Bar", SW_SHOW );
```

## Observed examples

| CVE | Description |
| --- | --- |
| 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. |

## Real CVEs with this weakness (sample of 12 of 454)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2023-38408 | openssh: Remote code execution in ssh-agent PKCS#11 support | critical | 9.8 | - | No | 2023-07-20 |
| CVE-2022-36344 | "JustSystems JUST Online Update for J-License" starts a program with an unquoted file path | critical | 9.8 | - | No | 2022-08-16 |
| CVE-2020-14521 | Mitsubishi Electric Factory Automation Engineering Products Unquoted Search Path or Element | critical | 9.8 | - | No | 2022-02-11 |
| CVE-2020-9292 | - | critical | 9.8 | - | No | 2020-06-04 |
| CVE-2019-17658 | - | critical | 9.8 | - | No | 2020-03-12 |
| CVE-2019-8459 | - | critical | 9.8 | - | No | 2019-06-20 |
| CVE-2025-8070 | Windows service registered with an unquoted ImagePath vulnerability in the system registry | critical | 9.2 | - | No | 2025-07-23 |
| CVE-2024-24722 | - | critical | 9.1 | - | No | 2024-02-19 |
| CVE-2025-12507 | Insecure service configuration – unquoted path | high | 8.8 | - | No | 2025-10-31 |
| CVE-2020-27645 | - | high | 8.8 | - | No | 2020-12-29 |
| CVE-2020-27644 | - | high | 8.8 | - | No | 2020-12-29 |
| CVE-2016-5793 | Unquoted Search Path or Element in Moxa Active OPC Server Unquoted Service Path Escalation | high | 8.8 | - | No | 2016-09-24 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-668](https://radicalnotion.ai/cwe/cwe-668) | Exposure of Resource to Wrong Sphere |
| Peer | [CWE-426](https://radicalnotion.ai/cwe/cwe-426) | Untrusted Search Path |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| PLOVER | Unquoted Search Path or Element | - | - |

## Frequently asked questions

### 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?

454 recorded CVEs are attributed to CWE-428, including CVE-2023-38408, CVE-2022-36344 and 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?

454 recorded CVEs are caused by CWE-428; none are currently in CISA's KEV catalog of actively exploited flaws.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/428.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-428). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
