HTTP REQUEST SMUGGLING TO BYPASS FRONT-END SECURITY IN TE.CL
A lab environment used a front-end that honoured the Transfer-Encoding header while the back-end honoured Content-Length, so a crafted request could be split and the smuggled second request reached the admin endpoint. The attacker used this to reach /admin without authentication and delete a user.
Published on medium.com
In a recent CTF I was given a challenge where i was supposed to delete a user by accessing admin panel. The configuration was TE.CL(front end understood transfer encoding and backend understood content length).
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 front-end and back-end disagreed on how to determine request boundaries because one used Transfer-Encoding and the other used Content-Length, with no normalisation between them.
Impact
An unauthenticated attacker could reach the admin panel and delete a user, but only in a lab environment set up for this exercise.
What the attacker needed
A lab with TE.CL mismatch; ability to send raw HTTP requests
How it was found
- Craft a request with both Content-Length and Transfer-Encoding headers so the front end and back end disagree on the body length.
- Place a smuggled request to the admin delete endpoint inside the body, using a local host header.
- Send the request twice so the smuggled request is processed on the second attempt.
- View the second response in the browser to confirm admin access and the user was deleted.
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 request passes through a proxy to a server, both need to agree on where the request ends. If the proxy uses one length header and the server uses another, an attacker can hide a second request inside the first. The server then treats the hidden request as if it came from inside the network, so it can reach pages that normally need a login.
What is Smuggling / CRLF?
A front end and a back end split one connection's bytes into requests differently, letting an attacker hide a request inside another user's.