Cookieless DuoDrop: IIS Auth Bypass & App Pool Privesc in ASP.NET Framework (CVE-2023-36899 & CVE-2023-36560)
The cookieless session feature in ASP.NET Framework could be abused by repeating its URL pattern so that IIS path restrictions and authentication were bypassed, and so that an application ran under its parent's Application Pool. An attacker could reach protected pages without authenticating and run managed code in applications that should not support it, potentially escalating privileges on IIS.
soroush.me
Published on soroush.me
In modern web development, while cookies are the go-to method for transmitting session IDs, the .NET Framework also provides an alternative: encoding the session ID directly in the URL. This method is useful to clients that do not support cookies.
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 cookieless path rewriting removed only the first cookieless marker before the path was checked, so a second marker survived and changed the path after the restriction checks had already run.
Impact
An attacker could bypass IIS authentication and path filters to read protected pages, and could cause applications to run under a parent Application Pool, which could lead to privilege escalation on IIS.
What the attacker needed
IIS with ASP.NET Framework; Cookieless sessions enabled; A protected or blocked path exists
The fix
Microsoft addressed the original issues in one patch under CVE-2023-36899 and later addressed a new variant under CVE-2023-36560, though the patch only disabled the aggressive path replacement by default and the behaviour could be reintroduced through web.config settings.
How it was found
- Set up a site where a subdirectory requires authentication and another subdirectory such as bin is blocked by IIS.
- Request the protected page normally and observe the redirect to the login page.
- Request the same page with the cookieless pattern repeated twice inside the path.
- Observe that the page is served to the anonymous user without authentication.
- For the second issue, request a test page in a child application that uses a different Application Pool.
- Repeat the cookieless pattern twice and observe the page running under the parent Application Pool instead.
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.
Some older Microsoft web servers can carry a session identifier inside the web address instead of a cookie. The author found that writing this special part of the address twice confused the server about which folder and which worker process the request belonged to. That let people open pages that were meant to be locked or that were not supposed to run code at all.
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.