Course contentsShow
← Security
Lesson 1105 of 3,05223. Web Security - Modern Web AttacksFree lesson

HTTP Request Smuggling Fundamentals

Understanding how discrepancies between front-end and back-end HTTP parsing enable request smuggling attacks.

HTTP Request Smuggling Fundamentals

What you'll learn: How attackers exploit differences in how front-end and back-end servers interpret HTTP request boundaries to smuggle malicious requests.


The Core Problem

HTTP request smuggling occurs when a front-end server (like a reverse proxy or load balancer) and a back-end server disagree about where one HTTP request ends and the next begins. This discrepancy allows an attacker to "hide" a second request inside what appears to be a single request to the front-end.

How the Discrepancy Happens

HTTP supports two primary ways to determine request boundaries:

  • Content-Length header: Specifies the exact number of bytes in the request body
  • Transfer-Encoding: chunked: Indicates the body is sent in chunks, each with its own size marker

The vulnerability arises when:

  • The front-end uses Content-Length to parse requests
  • The back-end uses Transfer-Encoding: chunked (or vice versa)
  • An attacker sends both headers in a single request

A Simple Analogy

Imagine a security checkpoint where one guard counts passengers by head count while another counts by ticket numbers. If someone presents both a group ticket and individual tickets, the guards might disagree about how many people are in the group—allowing extra people to slip through unnoticed.

The Attack Flow

  1. Attacker sends a carefully crafted request with conflicting Content-Length and Transfer-Encoding headers
  2. Front-end processes it as one request and forwards it
  3. Back-end interprets the data differently and sees two requests
  4. The "smuggled" second request gets processed as if it came from the next legitimate user

Key Takeaway: HTTP request smuggling exploits parsing inconsistencies between servers that share a connection, allowing attackers to inject hidden requests that bypass security controls and poison other users' requests.