A weakness that lets an attacker run a malicious program because a Windows service uses a file path with spaces but no quotation marks. The system may search and execute the first matching file in earlier directories, enabling local privilege escalation when write access exists in the search path.
What the unquoted search path vulnerability means
An unquoted search path vulnerability appears when a Windows service is configured with a file path that contains spaces but is not wrapped in quotation marks. During service start-up, Windows may interpret the path as separate path segments and search earlier directories for an executable with the same name.
The problem is not the space itself, but the ambiguity it creates. If an attacker can place a malicious executable in a directory that the service search order reaches first, the service can launch the attacker’s file instead of the intended program.
Why it becomes a privilege escalation path
This weakness is dangerous because services often run with elevated privileges. If the service account has administrative or SYSTEM-level rights, the attacker’s program can inherit that authority when the service starts, turning a simple path bug into local privilege escalation.
The vulnerability is especially useful to attackers when they already have limited local access and can write to one of the directories in the search path. They do not need to replace the real service binary, they only need to control a location that the search order checks first.
How the attack works in practice
The exploitation pattern is straightforward: identify a service whose executable path contains spaces and no surrounding quotes, confirm whether a writable directory appears earlier in the search order, then place a malicious executable with the expected name there. When the service restarts, Windows may execute the attacker-controlled file.
This is closely related to other path handling and execution-order weaknesses, including search order hijacking and other forms of path interception. A useful way to think about it is that the service path becomes an execution decision, not just a configuration value.
For a broader view of how this technique fits into recurring Windows abuse patterns, see Persistence Techniques Guide, which covers services, search order hijacking and related execution-flow abuse.
Exposure, detection and remediation
Organisations should check service configurations, installed software and system hardening baselines for unquoted paths that include spaces. The most practical review points are service definitions, service wrappers, scheduled deployment scripts and any vendor-installed software that registers a Windows service.
Detection is usually a mix of configuration review and compromise hunting. If a service has already been abused, investigators should look for unexpected executables in writable directories, unusual service start behaviour, and evidence that a benign service launched a file from the wrong location.
Remediation is usually simple once identified, but the surrounding exposure may not be. Quote the path correctly, remove write access from search-path directories, and verify that service permissions do not allow untrusted users to plant executable files where the service can find them. The CWE Top 25 Guide is a useful reference for understanding how this kind of weakness fits into broader software defect patterns.
Risk and Threat Considerations
This weakness is attractive because it can turn a small configuration mistake into a reliable local privilege escalation path. The attacker is not breaking the service itself, they are abusing how the operating system resolves an ambiguous path and combines that with a privileged service context.
Failure mechanism: A writable directory earlier in the search order contains a malicious executable with the expected name, and the unquoted service path lets Windows select it before the intended binary.
Impact: The attacker’s code can run when the service starts, potentially with elevated privileges, enabling persistence, further privilege escalation and follow-on compromise.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
MITRE ATT&CK addresses the attack and risk surface, while CIS Controls v8 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| CIS Controls v8 | CIS-4 — Secure Configuration of Enterprise Assets and Software | Unquoted service paths are a configuration weakness that hardening should prevent. |
| CIS-5 — Account Management | Privileged service accounts make the escalation impact materially worse when this flaw is exploited. | |
| Recommendation — Harden service configurations and validate executable paths so ambiguous search order cannot be abused. Restrict service privileges and remove unnecessary account rights that increase escalation impact. | ||
| NIST SP 800-53 Rev 5 | CM-6 — Configuration Settings | This vulnerability is a dangerous service configuration issue that requires enforced secure settings. |
| AC-6 — Least Privilege | Exploitation matters most when the service runs with excessive privilege. | |
| Recommendation — Define and enforce secure service configuration settings that remove ambiguous executable paths. Reduce service privilege so a hijacked launch does not yield broad system authority. | ||
| MITRE ATT&CK | T1574.009 — Path Interception by Unquoted Path | This technique directly describes execution hijacking through unquoted Windows service paths. |
| Recommendation — Hunt for path interception abuse and verify services are not launching binaries from attacker-writable locations. | ||
Practitioner Guidance
Why practitioners should care: Treat unquoted service paths as a configuration defect with direct security impact, not as a cosmetic formatting issue. If a service runs with high privilege, this weakness can become a straightforward escalation route.
What to watch for: Prioritise services whose executable paths contain spaces and where the underlying directories are writable by non-administrators. Those are the conditions that make the vulnerability exploitable in practice.
Practitioner takeaway: Fix the path quoting, remove unnecessary write access and then confirm whether the service account and execution context still create an escalation opportunity.
Related resources from NHI Mgmt Group
- What are the signs that an unquoted search path vulnerability is being abused on an endpoint?
- What are the signs that a scheduled task is vulnerable to an unquoted search path issue?
- Why does an unquoted search path create privilege escalation risk on managed Windows devices?
- What causes Unquoted Search Path or Element?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 23, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org