Skip to content
Smuggling / CRLF Write-up Intermediate

$8,200 for Two Invisible Characters: CRLF Injection to Session Fixation

The login redirect parameter was reflected into a response header without stripping carriage-return and line-feed characters, allowing an attacker to inject arbitrary headers. By injecting a Set-Cookie header, an attacker could fixate a victim's session to a known identifier and then access the authenticated session after the victim logged in.

T4nv1 Follow

Published on medium.com

HTTP headers are separated from each other, and from the response body, by a carriage return followed by a line feed — two bytes, \r\n, that the protocol treats as pure structural syntax rather than content. If an application reflects user input into a header value without stripping those two bytes, an attacker…

T4nv1, 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

The application concatenated the user-supplied returnUrl parameter directly into the raw HTTP header block without stripping or encoding carriage-return and line-feed sequences.

Impact

Any user who follows a crafted link could be fixated into a session identifier the attacker already knows, allowing the attacker to access the resulting authenticated session immediately after the victim logs in, without needing to intercept, steal, or guess any credential or token.

What the attacker needed

Victim clicks a crafted link; victim logs in normally

The fix

The header-reflection sanitization was fixed within three days, and session issuance was hardened to always regenerate the identifier at login.

How it was found

  1. Send a request to the login endpoint with a returnUrl parameter containing a URL-encoded carriage return and line feed followed by a test header.
  2. Observe that the test header appears in the response, confirming header injection.
  3. Send a request with a returnUrl parameter that injects a Set-Cookie header setting a known session identifier.
  4. In a clean browser, load the crafted URL and confirm the cookie is set.
  5. Log in normally with a test account in that same browser.
  6. In a separate browser, manually set the same cookie value and load the dashboard to confirm authenticated access without entering credentials.

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 website sends a response, it uses special line-break characters to separate different parts of the response, called headers. If a website puts user input into a header without removing those line breaks, an attacker can add extra headers. Here, the attacker added a header that set a cookie, which is a small piece of data a website stores in your browser to remember you. By setting a cookie the attacker already knows, the attacker could later use that same cookie to access the victim's account after the victim logs in.

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.

More by T4nv1

View all

113 more disclosed reports, best first.

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.