Skip to content
Smuggling / CRLF Write-up Advanced

A Journey from Session Poisoning to CL.CL Request Smuggling

The application marked a session as privileged if a POST request had a positive Content-Length, but a proxy added a header to block admin access. By sending two Content-Length headers with different capitalisation, the attacker desynchronised the proxy and backend, allowing a smuggled request to reach /admin without the blocking header.

medium.com

Published on medium.com

In this challenge, we are tasked with retrieving a flag from a protected /admin endpoint. The architecture consists of an Apache reverse proxy sitting in front of a Python Flask application served by Gunicorn.

Mahmoud Fawzy, on medium.com

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 backend (Gunicorn) treated an underscore variant of the Content-Length header as equivalent to the standard header, while the frontend (Apache) ignored it, causing a request smuggling desynchronisation.

Impact

An attacker could bypass the proxy's access control and reach the protected /admin endpoint, retrieving the flag.

What the attacker needed

Access to the web application; ability to send raw HTTP requests

How it was found

  1. Send a POST request to /con with a body to mark the session as poisoned.
  2. Craft a request with both Content-Length and Content_Length headers, where Content_Length is set to 0 and Content-Length to the length of a smuggled request.
  3. Include a smuggled GET /admin request in the body, with a Host header of localhost and the poisoned session cookie.
  4. Send the crafted request to the server over a raw socket.
  5. Read the response to obtain the flag.

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.

The website had a rule: if you send any data in a POST request, your session becomes 'special' and can access the admin page. But a proxy in front added a header to every request to block admin access. The attacker tricked the proxy and the backend server into disagreeing about how long the request was, so a hidden second request slipped through without the blocking header.

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.

Similar reports

View all

Same bug class and techniques, clearest first.

Request smuggling and header injection

The lesson behind this report.

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.