Alternative link
A logic flaw in Windows local NTLM authentication allowed swapping the server context handle in the NTLM challenge message, enabling an unprivileged user to impersonate a privileged user and gain SYSTEM-level file write. This arbitrary file write could then be leveraged for privilege escalation to SYSTEM.
localpotato.com
Published on localpotato.com
The original lives on localpotato.com
We do not hold its text, 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 NTLM authentication protocol did not validate that the context handle in the Type 2 message was bound to the correct user, allowing an attacker to swap contexts between two concurrent authentications.
Impact
An attacker could elevate privileges from a standard user to SYSTEM by writing arbitrary files with SYSTEM privileges, potentially leading to full code execution.
What the attacker needed
Local access to the target machine; ability to coerce privileged authentication; SMB server without signing
How it was found
- Coerce the authentication of a privileged user against our server.
- Initiate an NTLM authentication of our client against a server service.
- Intercept the context 'B' (Reserved bytes) of the NTLM Type 2 message coming from the server service where our unprivileged client is trying to authenticate.
- Retrieve the context 'A' (Reserved bytes) of the NTLM Type 2 message produced by our server when the privileged client tries to authenticate.
- Swap context A with B so that the privileged client will authenticate against the server service on behalf of the unprivileged client and vice versa.
- Retrieve both NTLM Type 3 empty response messages and forward them in the correct order to complete both authentication processes.
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 a user logs in locally on Windows, the system uses a special authentication process where the client and server are on the same machine. The researchers found that by swapping a hidden identifier (called a context handle) in the authentication messages, they could trick the system into thinking a low-privileged user was actually a high-privileged one. This let them write files with SYSTEM privileges, which is the highest level of access on Windows.
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.