# Client-Side and Connection-Locked Desync > Desync variants that start from a header-injection primitive (request splitting) or that cannot poison a shared back-end connection, so the attack is shifted into the victim's browser or onto a self-reused connection. ## How it works Classic smuggling assumes the front-end freely multiplexes users over shared back-end connections. When it doesn't, several constrained variants still achieve cross-user impact: - **CRLF-powered desync / request splitting.** A header-injection primitive (reflected CRLF) that lets you inject `\r\n` into the upstream request is enough to split one request into two. Two consecutive CRLFs are simply a request boundary — no mutated headers, no RFC violation — so this works out-of-the-box and drives Response Queue Poisoning ([[raw/portswigger.net/crlf-powered-desync-attacks-beheading-http-streams-11100|CRLF-Powered Desync]]). A very common source is nginx configs that put `$uri` in `proxy_pass` (e.g. `proxy_pass http://backend$uri;`): nginx URL-decodes the normalized path, so `%0d%0a` in the request path becomes real newlines upstream. - **Connection-locked desync.** The front-end reuses an upstream connection only when the *client* reuses its own keep-alive connection. You must drive both from the client to line them up; cross-user impact then follows via the victim's browser or shared-IP users. - **IP-locked desync.** The poison only reaches requests from the same public IP (the front-end pins one upstream connection per client IP). Still exploitable against users behind the same VPN/NAT, or by moving the attack client-side. - **Browser-powered / client-side desync.** When you can't poison the shared connection directly, make the *victim's own browser* send the malformed request (e.g. via a short `Content-Length` on a request the browser issues), so the desync executes on their connection — manufacturing XSS "out of thin air" and stealing HttpOnly cookies that a normal XSS couldn't reach. Rapidly created-and-deleted iframes drive the attack without crashing the browser. - **Request tunnelling** (the limited cousin): when the front-end never reuses back-end connections, you can't affect other users, but you can smuggle a request fully unprocessed by the front-end — bypassing path rules and forging/leaking internal headers. Confirm with the HEAD technique, never the "send a flurry" test ([[raw/portswigger.net/http-2-the-sequel-is-always-worse-6639|HTTP/2: The Sequel]]). Underneath all of these is a **connection-reuse** decision: a proxy hands a connection to the next user while the previous request isn't cleanly finished (a body written with no delimiter, a body received and never read, a framing it never agreed to). Measured across Envoy, HAProxy, Jetty, Netty, Go net/http, Caddy and nghttpx, the poison depends on the write scheduler and detach logic — and pinning the connection pool does *not* decide whether the socket gets poisoned ([[raw/xclow3n.com/connection-reuse-leading-to-desync-12393|connection reuse → desync]]). ## Techniques / payloads - **Detect header injection** by injecting invalid HTTP syntax into the insertion point and watching for a predictable status (e.g. a bogus HTTP version → `505`, an injected `Transfer-Encoding` → `501`). Any "HTTP request header injection" finding should be escalated, not filed as low-severity. - **Escalate CRLF to a desync** by building a request-splitting payload (two CRLFs then a complete second request) and checking for RQP; `Connection: keep-alive` sometimes required. Burp AT's CRLF-Powered Desync skill automates the gadget/splitting/RQP phases from a header-injection issue ([[raw/portswigger.net/making-http-header-injection-critical-with-one-prompt-13154|one prompt]]). - **Custom-header injection** — when the reflection lands in an internal header (e.g. `X-Original-Url`) rather than the path, exit it and append a complete second request for RQP. - **WAF `%0d%0a` filters** are defeated with Unicode normalization / encoding on the injection point. Parser-inconsistency tricks — line folding, invisible/invalid bytes stripped inconsistently from header names — also smuggle framing past one hop ([[raw/rafa.hashnode.dev/research-exploiting-http-parsers-inconsistencies-990|Exploiting HTTP Parsers Inconsistencies]]). - **`Set-Cookie` injection** via a broken-out response header session-fixates the victim; breaking into the response body with two newlines gives reflected/stored XSS where Content-Type allows. ## Notable cases - **CDN-internal RQP** — a request-splitting desync inside a CDN's own infrastructure returned responses from unrelated tenants; `Host`-header steering captured requests, session cookies and auth tokens for thousands of hosted apps ([[raw/portswigger.net/crlf-powered-desync-attacks-beheading-http-streams-11100|CRLF-Powered Desync]]). - **Major streaming service** — only a connection-locked desync (realized after *HTTP/1.1 Must Die*) had impact; **another target** yielded an IP-locked desync via HTTP/2 + an injected `Expect` header, exploited through the victim's browser. - **2FA/HttpOnly-hardened target** — XSS was useless, so a `Set-Cookie`-injecting desync and a blind-XSS payload carried the attack; a self-inflicted mistake (logging every active user into the attacker's account, overwriting carts) illustrates how indiscriminate RQP is. - **Connection-reuse inventory** — of 19 back-end configs measured, 18 were safe; the unsafe paths (Go server independently of its client; Envoy/nghttpx empty-write-buffer detach; HAProxy expectation handling) show the bug lives in the write-scheduler/detach logic, not the pool pinning ([[raw/xclow3n.com/connection-reuse-leading-to-desync-12393|connection reuse → desync]]). ## Defenses - **nginx:** never use `$uri`/`$document_uri` in `proxy_pass`/`return`; don't build upstream requests from decoded, attacker-influenced path data. - Fix the header-injection root cause (encode/validate the reflected value); treat CRLF findings as potential critical desyncs. - **Enable HTTP/2 upstream** for a permanent, reliable fix; where HTTP/1.1 upstream remains, correct the connection-reuse/detach logic (don't reuse a connection whose previous request isn't cleanly finished) or disable reuse. - WAF `%0d%0a` checks are necessary but insufficient — they're bypassable via normalization. ## Related - [[HTTP Request Smuggling]] — parent guide. - [[CL.TE and TE.CL Desync]] · [[HTTP2 Downgrade Smuggling|HTTP/2 Downgrade Smuggling]] · [[Web Cache Poisoning]] · [[Header-Based Access Control Bypass]] · [[Session Management]] · [[DOM-Based XSS]] ## Sources - [[raw/portswigger.net/crlf-powered-desync-attacks-beheading-http-streams-11100|CRLF-Powered Desync Attacks: Beheading HTTP Streams]] - [[raw/xclow3n.com/connection-reuse-leading-to-desync-12393|Smuggling Shouldn't Exist Anymore, Right? (connection reuse)]] - [[raw/portswigger.net/making-http-header-injection-critical-with-one-prompt-13154|Making HTTP header injection critical with one prompt]] - [[raw/portswigger.net/http-2-the-sequel-is-always-worse-6639|HTTP/2: The Sequel is Always Worse]] - [[raw/rafa.hashnode.dev/research-exploiting-http-parsers-inconsistencies-990|Exploiting HTTP Parsers Inconsistencies]]