HTTP request smuggling across API proxies
Proxy and backend disagreement about HTTP message boundaries can change how requests are routed. Understanding HTTP request smuggling across API proxies helps establish which security property the feature needs and where that property is actually enforced.
What does this involve?
A framework provides useful security mechanisms only when the application uses them consistently and deploys them with appropriate settings. Custom handlers, plugins and alternate execution paths can bypass protections that the development team assumes are automatic.
This section explains how the structure and header fields of an HTTP message should be validated to prevent attacks such as request smuggling, response splitting, header injection, and denial of service via overly long HTTP messages.
Why it matters
Consider a realistic failure: one connection causes the backend to process a request different from the one the gateway checked.
A configuration or integration mistake can affect many routes at once. The important question is which application data and operations become reachable, rather than whether a framework option merely differs from its default.
An API review follows the server-side behaviour behind the interface. Direct requests, alternate methods and background operations can reveal boundaries that the normal frontend journey does not exercise.
How penetration testers check for it
Review supported protocols, framing and transformations across the actual request chain.
- Confirm that all application components (including load balancers, firewalls, and application servers) determine boundaries of incoming HTTP messages using the appropriate mechanism for the HTTP version to prevent HTTP request smuggling. In HTTP/1.x, if a Transfer-Encoding header field is present, the Content-Length header must be ignored per RFC 2616. When using HTTP/2 or HTTP/3, if a Content-Length header field is present, the receiver must ensure that it is consistent with the length of the DATA frames.
- Confirm that when generating HTTP messages, the Content-Length header field does not conflict with the length of the content as determined by the framing of the HTTP protocol, in order to prevent request smuggling attacks.
- Confirm that the application does not send nor accept HTTP/2 or HTTP/3 messages with connection-specific header fields such as Transfer-Encoding to prevent response splitting and header injection attacks.
- Confirm that the application only accepts HTTP/2 and HTTP/3 requests where the header fields and values do not contain any CR (\r), LF (\n), or CRLF (\r\n) sequences, to prevent header injection attacks.
- Verify that, if the application (backend or frontend) builds and sends requests, it uses validation, sanitization, or other mechanisms to avoid creating URIs or HTTP request header fields, which are too long to be accepted by the receiving component. This could cause a denial of service, such as when sending an overly long request, which results in the server always responding with an error status.
- Inspect custom integrations and security overrides.
- Test important negative cases alongside ordinary functionality.
How to fix it
Use consistent maintained HTTP components and reject ambiguous message framing.
- Use maintained framework features and supported versions.
- Keep security-sensitive configuration explicit and reviewed.
- Avoid unnecessary custom replacements for trusted mechanisms.
- Retain regression checks for the application's actual trust boundaries.
A secure framework cannot determine every business permission or data ownership rule. Those requirements still need clear application design and enforcement.
Recheck the changed behaviour against the original failure conditions and the legitimate user journey. Keep enough evidence to show which release and configuration were verified, and include related entry points that depend on the same security decision.
Related issues
- API request schema and content type validation
- Server-side request forgery through API integrations
- Ambiguous API parameters and duplicate JSON keys
Read about our methodology or contact pentested.com to discuss your APIs and integrations.