A Windows service misconfiguration where the executable path contains spaces but is not wrapped in quotes. The system may interpret the path incorrectly and attempt alternate executable locations, which can allow local attackers to hijack execution if they can place a file in a preferred search path.
What the vulnerability is and why it matters
An unquoted service path is a Windows service configuration flaw, not a software bug in the executable itself. When the service binary path contains spaces and is not enclosed in quotes, Windows can misparse the path and try earlier locations in the search sequence, creating an opportunity for local execution hijack.
The security issue is the boundary between configuration and code execution. A service that runs with elevated rights can become a privilege escalation target if an attacker can place a malicious executable in a directory that Windows may probe before the intended binary.
How the execution hijack happens
The weakness depends on how Windows resolves the path string. For example, a path such as C:\Program Files\App Folder\Service.exe can be interpreted in segments if it is not quoted, so the system may attempt alternate file names that correspond to earlier path fragments. That turns a benign spacing mistake into an execution-control problem.
The technique is often paired with local file placement or weak directory permissions. If the attacker can write to a searched location, the service startup sequence may load the attacker-controlled program instead of the intended one.
For defenders, this is best understood as a form of execution flow hijacking, because the attacker is abusing path handling to redirect which binary starts under service context.
Where organisations should look for exposure
Exposure is usually found through service inventory, not by chasing alerts. Focus on Windows services whose ImagePath values contain spaces, especially where the service runs as LocalSystem or another privileged account and where the binary lives in a location that is writable by non-administrators.
Review service creation and change activity alongside file-system permissions. Unquoted paths often matter most when paired with weak ACLs, inherited permissions, or directories that ordinary users can modify.
This is also a broader Windows hardening concern, so the same review should be paired with service-account and privilege review in Windows Services and Service Account Security Guide and with escalation patterns in Windows Privilege Escalation Techniques Guide.
Prevention, detection, and post-exploitation review
The primary fix is to quote the service path correctly and verify that the service binary resides in a protected location with tight write permissions. If you cannot patch or reconfigure immediately, reduce the chance of abuse by removing unnecessary local write access, monitoring for unexpected files in candidate directories, and limiting who can create or modify services.
Detection should include service configuration drift, suspicious executable creation near service paths, and process starts that do not match the expected service binary. Because this pattern can be part of a broader hijack chain, it is worth checking adjacent tactics such as DLL search-order abuse and other path-based redirection methods.
The broader persistence and hijack perspective is covered in the Persistence Techniques Guide, while the general weakness class is also a close match for the CWE Top 25 Guide.
Risk and Threat Considerations
An unquoted service path becomes dangerous when a privileged Windows service can be redirected to an attacker-controlled executable. The risk is local privilege escalation, service takeover, and in some cases a foothold that survives reboots because the hijack occurs during normal service startup.
Failure mechanism: Windows misinterprets an unquoted path with spaces, probes alternate filenames, and launches the first executable it finds in a writable search location.
Impact: A local attacker can gain code execution in the security context of the service, which can expose administrator-level access, persistence, and lateral movement opportunities.
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 |
|---|---|---|
| MITRE ATT&CK | T1574 — Hijack Execution Flow | Unquoted service paths redirect Windows execution to alternate binaries. |
| Recommendation — Map service-path hijack indicators to T1574 and hunt for redirected execution in startup telemetry. | ||
| CIS Controls v8 | CIS-4 — Secure Configuration of Enterprise Assets and Software | This misconfiguration is prevented by secure Windows service configuration and hardening. |
| CIS-2 — Inventory and Control of Software Assets | Finding exposed services requires accurate software and service inventory. | |
| CIS-6 — Access Control Management | Abuse depends on writable directories and overbroad local permissions. | |
| Recommendation — Enforce secure service configuration baselines and remediate unquoted paths in standard builds. Maintain service inventory so unquoted service paths can be found and corrected quickly. Restrict write access to service directories and remove permissions that enable executable placement. | ||
| NIST SP 800-53 Rev 5 | CM-6 — Configuration Settings | Service path quoting and approved Windows hardening settings are configuration controls. |
| AC-6 — Least Privilege | The attack succeeds when low-privilege users can write to paths used by privileged services. | |
| Recommendation — Set and enforce approved service configuration values, including quoted executable paths. Apply least privilege so non-admin users cannot place executables in service search paths. | ||
Practitioner Guidance
What to watch for: Treat any service path containing spaces as suspect until it is verified as correctly quoted and the surrounding directories are locked down. In practice, the highest-value reviews are for services that start automatically, run with high privilege, or point to binaries in user-writable locations.
Governance implication: Service configuration review should be part of Windows baseline hardening, because a one-line path mistake can create an escalation path that traditional application patching will not remove.
Practitioner takeaway: Fixing the quotes is necessary, but not sufficient, if the surrounding filesystem permissions still let an attacker place a replacement executable where Windows may look.
Related resources from NHI Mgmt Group
- What breaks when a Windows service runs from an unquoted path?
- Why does an unquoted service path increase the risk of privilege escalation?
- How should security teams respond when an unquoted service path is found on a privileged Windows service?
- What are the signs that an unquoted search path vulnerability is being abused on an endpoint?
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 31, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org