HTTP request smuggling and desync testing
How to test HTTP request smuggling, CL.TE, TE.CL and HTTP/2 downgrades safely. A technical methodology for detection, hardening and retesting.
- AUTHOR
- Karol Rapacz / Penetration Tester (OSCP, PNPT)
- PUBLISHED
- 3 April 2026
- READING TIME
- 19 min read
- TOPIC
- Web Application Penetration Testing
HTTP request smuggling, also called an HTTP desync attack, exists when two or more components processing the same traffic stream disagree about a request boundary. A reverse proxy may consider a message complete while the application server treats some of the same bytes as the beginning of the next request. The edge security control and the backend are no longer evaluating the same message.
The short answer: a reliable HTTP request smuggling pentest is not a bulk run of familiar payloads. It first reconstructs the complete CDN–WAF–load balancer–gateway–backend chain, compares HTTP/1.1 framing and HTTP/2 translation, and then proves a discrepancy on an isolated connection and unique test resource. Evidence should affect only tester-controlled accounts and data; poisoning a real user’s request queue is unnecessary and unsafe.
This vulnerability matters most in applications behind several proxy layers. Each component may normalise headers, downgrade protocols, buffer a body or reuse an origin connection. The same application can therefore be safe when reached directly and vulnerable only after a particular CDN or routing rule is enabled.
What becomes desynchronised in an HTTP stack?
HTTP is stateless semantically, but HTTP/1.1 commonly transports successive requests over one TCP or TLS connection. A recipient must know exactly where the current message body ends. RFC 9112 Section 6.3 defines the precedence for determining message length, while Section 11.2 explicitly discusses request smuggling caused by parser differences.
A production architecture presents at least four separate interpretations:
| Layer | Security-relevant decision | Common visibility gap |
|---|---|---|
| CDN or WAF | whether a request is valid and how long it is | observes the message before translation |
| Reverse proxy | how HTTP/2 or HTTP/3 becomes an upstream request | may add, remove or normalise framing |
| Application gateway | which backend receives the stream | may reuse connections across clients |
| Application server | how many bytes belong to the current request | parses an already transformed message |
The classic labels CL.TE and TE.CL describe whether a front end and backend prefer Content-Length or chunked transfer encoding. They are not a complete model of modern risk. Testing also needs to consider CL.0, early responses, pause-based desync, duplicate-header handling and HTTP/2-to-HTTP/1.1 conversion. The primary research HTTP/2: The Sequel Is Always Worse demonstrated how a protocol with unambiguous frame lengths can still create vulnerabilities when it is downgraded incorrectly.
The practical conclusion is important: a team is not testing “Nginx” or “the Java app” in isolation. It is assessing one concrete composition of parsers, settings and production routes.
Why can HTTP desync have critical impact?
A boundary discrepancy does not automatically mean complete compromise. It is a primitive that may alter the context of the next request. Actual impact depends on connection sharing, routing and available application gadgets. Relevant outcome classes include:
- bypassing a WAF rule when the backend sees a request the edge never evaluated as an independent message;
- misaligning requests and responses on a reused connection;
- poisoning a web cache when a manipulated response is stored under a public resource key;
- reaching an internal route available to the proxy but not to an external client;
- exposing a session or data if another user’s request is attached to a controlled response;
- degrading availability when servers wait for different byte counts and exhaust a connection pool.
Not every timeout is a vulnerability, and a parsing discrepancy without a reachable consequence may have limited severity. A report should separate three levels: a parser anomaly, a confirmed desynchronisation and demonstrated business impact. This distinction prevents severity inflation and directs remediation to the correct layer.
Scope and rules for safe testing
Request smuggling is a higher-risk test because connection state may affect the next client. Before execution, written rules should establish:
- in-scope hosts, CDN regions, origin addresses and protocol versions;
- the designated environment and whether real user traffic can be removed;
- the testing window, incident contact and immediate stop condition;
- tester-owned accounts, tenants, paths and canary headers;
- permitted connection count and timeout, with availability testing excluded unless separately authorised;
- access to front-end and backend logs so interpretation can be proven without escalating the attack;
- a procedure to purge caches and recycle connection pools afterwards.
A staging environment that faithfully reproduces the production chain is safest. If production testing is necessary, use a dedicated hostname, isolated backend or route pinned to a test-only pool. A separate application user is not enough when the reverse proxy shares upstream connections between clients.
The engagement should sit within a broader web application penetration testing methodology. Request smuggling is one part of an assessment, not a substitute for access-control and business-logic coverage.
Technical HTTP desync penetration testing methodology
1. Map every parser
Begin with the actual request path. Record the protocol negotiated from client to edge, the protocol used at each subsequent hop, TLS termination, keep-alive behaviour, buffering and retries. Examine the primary web application, API, administration interface, upload routes and serverless endpoints separately because they frequently use different origins.
In black-box work, diagnostic headers, response differences, ALPN and controlled errors provide clues, but they should not replace configuration evidence. In a grey-box engagement, review CDN rules, ingress controllers, service meshes, application proxies and HTTP framework settings. Translation points and header rewriting deserve particular scrutiny.
2. Establish a clean baseline
For each route, send valid requests with and without bodies, use relevant methods and exercise every supported HTTP version. Measure response time, connection closure, error status and the behaviour of the next valid request on the same channel. A baseline prevents rate limiting, cold starts, origin retries and network instability from becoming false positives.
Where the environment permits it, capture raw bytes on both sides of the proxy. The tester’s client view does not reveal what the backend received after normalisation.
3. Test one discrepancy at a time
Evaluate a single hypothesis per test: conflicting length signals, a duplicate field, unusual method semantics, an early response or protocol translation. Use a minimal harmless body and a unique identifier. Observe whether the front end and backend record different message counts, lengths or error outcomes.
Safe proof does not require inserting an operational request into another person’s stream. In an isolated pool, establish controlled connection A, send the probe and follow it with your own request B to a nonexistent canary path. If backend telemetry places the canary at a different boundary from proxy telemetry, the desynchronisation is established without third-party data.
The OWASP Web Security Testing Guide documents the goal and core testing concepts. Automated extensions can improve variant coverage, but production use requires low concurrency and disabled risky modes.
4. Examine HTTP/2 and HTTP/3 boundaries
Do not stop at the protocol visible in a browser. A CDN may accept HTTP/2 or HTTP/3 and forward HTTP/1.1 to the origin. Determine whether pseudo-headers, frame length and regular fields become one canonical representation. Invalid values must be rejected before forwarding, and an upstream connection should be closed after a parsing error.
End-to-end HTTP/2 materially reduces traditional length conflicts, but it does not eliminate implementation defects, request tunnelling or risk introduced by later translations. “HTTP/2 is enabled on our CDN” is not evidence that the complete chain is safe.
5. Demonstrate the minimum impact
Only after a discrepancy is established should the assessor determine whether it affects a controlled resource. Suitable targets include the tester’s own response, a dedicated diagnostic endpoint or a cache key containing a random tester-only parameter. Login, payment and customer-data endpoints are inappropriate. Never try to capture another session’s request.
If even minimal validation might transfer state between users, stop with multi-layer telemetry. Correlated logs from two parsers provide stronger and safer evidence than a visible effect against a real user.
6. Retest the entire request chain
Changing one WAF signature is not a complete repair. Repeat testing through every protocol and route, inspect error behaviour, and establish that ambiguous messages are rejected without connection reuse. Then run regression tests for legitimate uploads, webhooks and large bodies so hardening does not break business functions.
Detecting HTTP request smuggling
A single access log cannot expose an interpretation conflict. Detection needs edge-to-origin correlation using an identifier assigned before normalisation and retained at the backend. Useful signals include:
- a different request count for one correlation ID across proxy and origin;
- method, path or declared-length differences between edge and backend records;
- clusters of
400,408or connection resets following framing anomalies; - a response assigned to a different request ID than the front end expected;
- request-line-like text appearing in header values or parser diagnostics;
- growth in backend connections waiting for incomplete bodies;
- cache hits or misses inconsistent with the canonical method and URI.
Log the protocol version at every hop, the chosen body-length mechanism, normalisation result and rejection reason. Bodies may contain sensitive data, so telemetry should prefer metadata, hashes and carefully bounded samples. Detection must be validated against legitimate clients because older SDKs and upload libraries can generate unusual but acceptable traffic.
Hardening the complete class of vulnerability
The strongest design rule is one canonical interpretation before forwarding. Operationally, that means:
- running current, supported HTTP servers and proxies;
- retaining HTTP/2 or HTTP/3 end to end where architecture permits;
- rejecting ambiguous framing instead of trying to repair it;
- removing hop-by-hop fields correctly and keeping them away from application logic;
- applying consistent rules for field names, whitespace and duplicates;
- closing the connection after parsing errors, early responses or incomplete bodies;
- removing unnecessary downgrades and testing every required conversion;
- limiting backend connection reuse as impact reduction, not as the sole fix;
- defining explicit cache rules for dynamic and authenticated responses;
- running parser differential tests in CI/CD after CDN, ingress or framework changes.
RFC 9112 treats a message containing both Transfer-Encoding and Content-Length as potentially related to request smuggling and defines safe handling before forwarding. A WAF signature matching a few known strings cannot provide protocol compliance.
Map these controls to OWASP ASVS 5 implementation requirements, particularly architecture, input handling and communications. For service interfaces, use the REST, GraphQL and OAuth API pentest checklist as well: desync may only expose the underlying authorisation flaw.
What the finding report should contain
The report must let engineers understand root cause without running a hazardous exploit. Include a hop diagram, negotiated protocols, relevant versions and settings, the interpretation difference, correlated evidence from both sides, prerequisites for impact and a minimal safe proof. Separate an immediate containment action, such as disabling a route, from the durable parser or translation fix.
Risk scoring should reflect connection sharing, access to potential victims, primitive reliability, reachable endpoints and the ability to bypass other controls. A label such as “CL.TE” without a data-flow explanation is not enough for either an application engineer or CDN administrator.
If the affected path traverses a cloud gateway or service mesh, extend the analysis using the AWS, Azure and GCP cloud penetration testing guide. The OWASP API security guide helps prioritise any API control the desync condition makes reachable.
Engineering checklist
- We maintain a current diagram of all HTTP hops and TLS termination points.
- We know the client-to-edge and upstream protocol for every route.
- Ambiguous framing is rejected and the connection is closed.
- Parsing errors are correlated between proxies and backends.
- Tests use a dedicated pool, tester-owned identities and random canaries.
- Automated scanning uses low concurrency and safe modes.
- Caches never store authenticated responses or parser errors.
- Every protocol downgrade has regression coverage.
- CDN, ingress and HTTP framework upgrades trigger a retest.
- Reports distinguish anomaly, desynchronisation and demonstrated impact.
- Incident procedures include cache purge and connection-pool recycling.
- Remediation is verified with negative and legitimate-traffic tests.
Primary technical sources
- RFC 9112 — HTTP/1.1 message framing and request smuggling
- OWASP Web Security Testing Guide — Testing for HTTP Request Smuggling
- PortSwigger Research — HTTP Desync Attacks: Request Smuggling Reborn
- PortSwigger Research — HTTP/2: The Sequel Is Always Worse
- PortSwigger Research — Browser-Powered Desync Attacks
Need to validate a layered HTTP stack safely? An authorised assessment should cover the exact CDN, WAF, proxy and backend configuration rather than only the public address. A controlled environment, correlated evidence and a focused retest establish risk without exposing users.