December 9, 2023

AWS API Gateway is a popular managed service for developers to write, manage, and secure their APIs in a Web environment. A space between characters and a few random letters,able to modify the HTTP header sent to Amazon API Gateway.

At this week’s Black Hat Europe, Researchers found flaws in the service that allowed to bypass the API Gateway’s IP address restrictions and wage a cache poisoning attack using so-called HTTP header smuggling.


Header smuggling is a technique in which an attacker dupes a front-end server into sneaking malicious or phony information to the back-end server within the HTTP header, for example. HTTP (and HTTPS) headers carry information such as the client’s browser, cookies, and IP address, as well as the requested Web page.

Hackers was able to easily modify the HTTP header merely by typing a space in the header name and then some random letters. Specifically, adding “X-Forwarded-For abcd: z” to the header for HTTP requests, which bypassed the AWS IP address restriction policies in AWS API Gateway. The front-end server tries to strip out invalid headers, but it can’t see the modified header, so it slips to the back-end server,

IP address restrictions bypass “hack” using HTTP header-smuggling were relatively simple to execute, he says it would be hard for an attacker to exploit because they would need to have some knowledge or insight into a target’s whitelisted IP addresses. AWS quickly fixed the IP restriction bypass flaw after he reported it, Thatcher says.

A second hole in AWS API Gateway that allowed to use HTTP header smuggling to sneak phony headers to the back end and employ a cache poisoning attack on the server, which could let an attacker create their own API and return malicious content. The attacker then could overwrite entries in the victim’s server cache and wrest control of the content of the API. AWS has since fixed the second vulnerability.


A free open source tool testing Web servers for weaknesses that could allow an attacker to pull off an HTTP header-smuggling attack. It looks for header mutations that could leave the door open for HTTP header-smuggling, provides a way for researchers to smuggle various headers through to the back-end server.

Besides scanning for HTTP header-smuggling weaknesses, other ways to protect against this attack include ensuring front-end servers can’t forward unconventionally formatted headers like Thatcher was able to do, and ensuring the back-end server is more particular about the HTTP requests it accepts.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.