---
title: "Make every server agree where a request · Agent Wranglers"
url: https://agentwranglers.se/playbook/adversarial-testing/requests-and-files/request-smuggling
updated: 2026-10-21
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Make every server agree where a request ends

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Requests and files](https://agentwranglers.se/playbook/adversarial-testing/requests-and-files.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

- ID: SEC-54
- Level: Recommended
- Chapter: [Requests and files](https://agentwranglers.se/playbook/adversarial-testing/requests-and-files)
- Rule: Refuse every request whose length is unclear, so a proxy and the app behind it never read one request as two.
- Applies when: The project runs its own servers, virtual machines or containers.
- How: Request smuggling hides a second request inside the first. It works when a CDN, load balancer or proxy reads the length differently from the app server. RFC 9112 says a request with both `Transfer-Encoding` and `Content-Length` ought to be handled as an error. Refuse it at the edge with 400 and close the connection. Refuse two different `Content-Length` headers and any `Transfer-Encoding` other than `chunked` the same way. Use HTTP/2 from the proxy to the app where both support it. Keep the proxy and the app server current, as [keep software current and quiet](https://agentwranglers.se/playbook/adversarial-testing/supply-chain-and-setup/patch-and-hide-versions) says, because most smuggling holes are parser bugs.
- Check: On the test copy, send a request through the front proxy with both `Content-Length: 4` and `Transfer-Encoding: chunked`. Then send one with two different `Content-Length` headers. Both get 400, and the proxy closes the connection.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### HTTP example

```http
POST /search HTTP/1.1
Host: staging.example.com
Content-Length: 4
Transfer-Encoding: chunked

0

GET /admin HTTP/1.1

HTTP/1.1 400 Bad Request
Connection: close
```

## Sources

- [RFC 9112 section 6.3 Message Body Length](https://www.rfc-editor.org/rfc/rfc9112#section-6.3)

## Related rules

- [Keep software current and quiet](https://agentwranglers.se/playbook/adversarial-testing/supply-chain-and-setup/patch-and-hide-versions) in Security testing

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/adversarial-testing/requests-and-files/request-smuggling">Agent Wranglers security testing playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Keep private pages out of shared caches](https://agentwranglers.se/playbook/adversarial-testing/requests-and-files/private-responses-uncached)
- Next: [Keep unkeyed headers from changing cached pages](https://agentwranglers.se/playbook/adversarial-testing/requests-and-files/web-cache-poisoning)
- [Requests and files](https://agentwranglers.se/playbook/adversarial-testing/requests-and-files)
