When ntuser.pol leads you to SYSTEM
When Group Policy caching is disabled, the Group Policy service running as SYSTEM renames and then deletes the ntuser.pol file inside a user-writable directory. By abusing symbolic links and an oplock to block the deletion, an attacker can get a file of their choosing written with SYSTEM privileges, leading to privilege escalation.
decoder.cloud
Published on decoder.cloud
This is a super short writeup following myprevious post . My last sentence was a kind of provocation because I already knew that there were at least 2 “bypasses” for CVE-2020-1317.
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 Group Policy service performs a rename and delete on a file in a directory writable by the user, without protecting against symbolic links or sharing violations, so the operation can be redirected to a privileged location.
Impact
An attacker with a domain user account could write an arbitrary file into a protected system directory with SYSTEM privileges, which could lead to full privilege escalation; the text notes this requires Group Policy caching to be disabled, which is the default on Windows Servers.
What the attacker needed
A domain user account; Group Policy caching disabled; certain policies configured; attacker can create symlinks
The fix
The text says the issue was fixed in the latest security updates, though it does not describe the fix itself.
How it was found
- Disable Group Policy caching (it is off by default on Windows Servers) and configure policies so ntuser.pol is written to the per-SID folder under ProgramData.
- Remove the hidden and system attributes from ntuser.pol and observe with Process Monitor that the service renames it to tempntuser.pol and then deletes it.
- Create symbolic links via the RPC Control object directory so the rename target points to a privileged location such as System32.
- Place the source file (a DLL) in a directory the attacker fully controls so it keeps its permissive ACL when moved.
- Run a helper program that waits for the file to appear in the target directory and then places an oplock to block the deletion through a sharing violation.
- The attacker's file ends up written in System32 with full control over it.
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.
Windows stores some Group Policy settings in a file called ntuser.pol inside a folder that ordinary domain users can fully control. A background service running with the highest Windows privileges (SYSTEM) renames and deletes that file. By planting a link in that folder and briefly locking the file so the delete fails, the attacker makes the service place their own file, with their own contents, into a protected system folder.
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.