Windows Task Scheduler Application, Version 19044.1706 Advisory
Windows Task Scheduler failed to properly quote executable paths when an environment variable was used and the remainder of the path contained no spaces, leading to an unquoted search path vulnerability. An attacker with write access to the root of the C: drive could place a malicious executable there and have it run in the context of another user or SYSTEM.
Published on bishopfox.com
The following document describes identified vulnerabilities in the Windows Task Scheduler application version 19044.1706.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the Task Scheduler checks for spaces in the path to decide whether to add quotes but does not expand environment variables before that check, so a path with an environment variable and no spaces after it is treated as not needing quotes.
Impact
A local user with write access to the root of the C: drive could execute code in the context of another user or SYSTEM, resulting in horizontal or vertical privilege escalation; by default only administrators have such write access, so the severity is typically low but was raised to medium because the issue may affect any scheduled task.
What the attacker needed
Write access to C:\ root; local access to the system
The fix
The vulnerability was fixed by an automatic Windows update available after January 10, 2023.
How it was found
- Create a malicious executable named C:\Program.exe.
- Wait for Windows to launch the vulnerable scheduled task (e.g., PLUGScheduler).
- The malicious executable runs in the context of the scheduled task's user (e.g., SYSTEM).
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When Windows starts a program, it needs to know exactly where the program file is. If the path to the program is not wrapped in quotation marks and contains spaces, Windows may get confused and try to run a different file with a similar name. Here, a built-in scheduled task used a path with an environment variable (like %ProgramFiles%) and no spaces after it, so Windows ignored the quotes and could be tricked into running a malicious file placed at C:\Program.exe.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.