Skip to content
Smuggling / CRLF Write-up Advanced

How an Akamai misconfiguration earned us USD 46.000

An Akamai misconfiguration allowed manipulation of the Connection header to perform request smuggling and cache poisoning, enabling arbitrary content to be cached from other hosts. Attackers could redirect users and poison caches with malicious files.

Francesco Mariani Follow

Published on blog.hacktivesecurity.com

Bounty$46,000total stated by author View original

A few months ago me and my friend Jacopo Tediosi made an interesting discovery about an Akamai misconfiguration that allowed us to earn more than 46,000 dollars. Our research highlighted how manipulating a particular HTTP header made it possible to change the way how proxies communicated with each other and how this…

Francesco Mariani (@_medusa_1_), Jacopo Tediosi (@jacopotediosi), on blog.hacktivesecurity.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

Akamai sits in front of a large number of customer origins as a reverse proxy and CDN. The behaviour that interested us was the Connection header appearing in responses from servers under the Akamai network. In a correct HTTP/1.1 implementation the Connection header lists hop-by-hop options that apply to that single connection, and a proxy is expected to strip them before forwarding. Here the header was being reflected back in responses on several servers under the Akamai network.

From the original on blog.hacktivesecurity.com

The header still appeared in responses on a number of Akamai-fronted servers at the time of writing. That reflection was the thread we pulled.

Setup

There were no accounts, roles or special tooling involved in the discovery itself: the work was done by sending crafted HTTP requests at Akamai-fronted hosts and observing the responses. Later, to demonstrate real impact, we needed a second host inside the Akamai network, which we did not have at first, and that gap shaped the rest of the research.

Finding it

Many readers will already have tried to force a backend to use Content-Length instead of Transfer-Encoding. Our first attempts along those lines did not work: any attempt to abuse the Connection header with Content-Length as its value in order to perform a request smuggling attack failed.

What we did notice were unusual responses coming back from Akamai, for example:

From the original on blog.hacktivesecurity.com

And with www.example.com:

From the original on blog.hacktivesecurity.com

When we used the same host, the server returned different responses. As most people working in this area know, that alone is hard to attribute: it could be request smuggling, it could be HTTP pipelining, or it could be ordinary server behaviour triggered by setting Connection to keep-alive. The observation was interesting but not yet proof of anything.

Exploitation

Step 1: redirect requests between connections

Trying to redirect requests together with my co-worker, we found that it worked. At that point, however, all we had was a potential denial of service, and DoS reports are frequently rejected for lack of impact. To check whether we were looking at a genuine open desync rather than a local quirk, we repeated the tests from a different network.

Step 2: find a second host inside Akamai

Only later did we discover that by inserting another host within the Akamai network we could redirect requests between the two of us, which finally gave us a complete request smuggling primitive. This created a reporting problem: we had no host of our own inside the Akamai network, so how could we prove that an attacker could arbitrarily redirect users without logs to show?

Step 3: turn the desync into cache poisoning

As we kept trying, we were able to abuse the bug to arbitrarily cache content from other hosts. We also found that, in addition to GET, the OPTIONS method could be used to perform the attack, and that with OPTIONS there was a better chance that Akamai would not notice the request was malicious.

To poison the cache, the sequence was:

  1. Send a first GET or OPTIONS request to a nonexistent path, preferably with a static resource extension so the response was more likely to be taken from the cache. Using a nonexistent path also avoided causing damage to the platform.
  2. Send the second request to an arbitrary host.

After a couple of requests, the content of the second host's file was correctly cached because of its revalidation:

From the original on blog.hacktivesecurity.com

From then on it was possible to visit the URL /it/it/medusa.txt and receive the robots.txt of the second host:

From the original on blog.hacktivesecurity.com

The content we chose to cache was not malicious, but many file types could be cached this way, including HTML and JavaScript. That gave us a solid impact for the report.

Step 4: the proof of concept

HTTP
OPTIONS /random.txt HTTP/1.1
Host: ORIGINAL-HOST
Connection: Content-Length
Content-Length: 42

GET /robots.txt HTTP/1.1
Host: ARBITRARY-AKAMAI-HOST
x: 1

The first block is an OPTIONS request for a nonexistent static-looking path on the original host, carrying Connection: Content-Length and a Content-Length of 42. The second block is a GET for /robots.txt on an arbitrary Akamai host, terminated with a dummy x: 1 header. Sending this request twice made it possible to cache the contents of robots.txt from the second host.

Root cause

The report does not describe the internal implementation, so the precise mechanism is not stated.

The attack worked with both GET and OPTIONS, and OPTIONS was less likely to be flagged as malicious. Not every Akamai host was vulnerable: some did not allow arbitrary content caching, probably because they had no cache or cache key settings that prevented the attack. We suspected a general misconfiguration rather than a per-customer one, which is why we also reported it through bug bounty platforms.

Impact

An attacker able to reach a vulnerable Akamai-fronted host could redirect requests between connections, which in our testing amounted to a potential denial of service on its own. With a second host inside the Akamai network, the desync became a full request smuggling primitive, and it could be used to poison the cache with arbitrary content chosen by the attacker, including HTML and JavaScript.

Disclosure and handling

As soon as the discovery was made we started responsible disclosure, reporting the vulnerability to Akamai. We did not receive immediate confirmation. While we waited, we noticed that not all Akamai hosts were vulnerable, or some did not allow arbitrary content caching, and we decided to report it on bug bounty platforms as well.

  • HackerOne: after a very short time the triagers were able to replicate and understand the vulnerability and assigned the right severity.
  • Bugcrowd: many triagers were unable to replicate it despite a curl one-liner, a video PoC and screenshots. Some did not put the two blank lines in the GET requests, others had wrong Burp targets, and we also received duplicated (?) responses, like:
From the original on blog.hacktivesecurity.com
  • Microsoft: replied very late, saying it could not replicate the vulnerability, by which time Akamai had already introduced the fix.
  • Apple: responded late and could not replicate it because of Akamai's fix. They were very kind and thanked us by email, but no bounty was paid, and we did not want one.
  • Intigriti: we only filed a bug; the triager was very nice and friendly but marked it as a duplicate.

Fix

Akamai took very little time to ship the security fix after our report. Any attempt to use the Connection header in an inappropriate way is now automatically blocked. Akamai gave us permission to make a public disclosure.

From the original on blog.hacktivesecurity.com
  • Send Connection: Content-Length to other Akamai-fronted hosts and check whether the header is reflected in the response. A positive result is the header appearing back in the response on a host that should strip it.
  • Repeat the two-request OPTIONS PoC against a host with a cacheable static path. A positive result is the second host's file being served from the first host's URL after a couple of requests.
  • Try GET instead of OPTIONS where OPTIONS is blocked or filtered. A positive result is the same cached cross-host content.
  • Test hosts that appear not to be vulnerable, checking whether they have a cache and how their cache keys are configured, since the absence of caching prevents the poisoning step even when the desync is present.
  • Repeat the desync tests from a different network to distinguish a genuine open desync from local behaviour.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 15 min read.

What happened, in plain words

Two researchers, Francesco Mariani and Jacopo Tediosi, found a configuration mistake in Akamai, a company whose servers sit in front of many websites and act as a protective middle layer. The mistake let them manipulate a particular HTTP header, which is a small line of text that a browser or a server attaches to a request or a response to give extra instructions. By changing that header they could perform request smuggling attacks and, in particular cases, poison the cache with content of their choosing. That disagreement is called request smuggling, and in this case it also let them plant content of their choosing into Akamai's cache, the storage layer that keeps copies of pages so they load faster for everyone. They earned more than USD 46,000 for the finding.

This article walks through the same story for someone who has never done security work. Every technical word is explained the first time it appears, and every request they sent is shown exactly as they sent it, followed by a plain description of each line.

The background you need first

Before the story makes sense, a few ideas need to be in place. None of them require any tools beyond a browser.

HTTP is the language browsers and servers use to talk. When you type an address, your browser sends a request made of a first line (the method, such as GET, and the path), then a set of header lines, then a blank line, then optionally a body. The server answers with its own status line, headers and body. Think of it as a letter with an address on the envelope, some handling notes stapled to it, and the actual content inside.

A reverse proxy is a server that stands in front of the real website and passes requests through to it. It is like a receptionist who takes every visitor's message, checks it, and hands it to the right person inside. Akamai runs a very large network of these, and also acts as a CDN (content delivery network): a set of servers spread around the world that keep copies of files so users get them quickly from somewhere nearby.

A cache is that copy store. When many people ask for the same file, the CDN keeps one copy and serves it to everyone instead of asking the original website each time. This is the feature that made the attack serious, because if an attacker can put their own content into the cache, every later visitor to that address receives the attacker's content.

The Connection header is a note on an HTTP message that lists options applying only to that one connection between two machines. The HTTP specification says a proxy must remove such notes before passing the message on, because they are meant for the immediate neighbour, not for the final destination. Think of a sticky note saying "handle this while you are holding it" that the receptionist is supposed to peel off before handing the letter inside.

Content-Length and Transfer-Encoding are two headers that tell a server how big a request body is. Content-Length gives a number: so many bytes. Transfer-Encoding: chunked says the body arrives in pieces, each piece labelled with its size. A server must never be told both, because then two machines can count the body differently and one of them will start reading the next request too early. That mismatch is the heart of request smuggling.

Request smuggling is the attack that results. Two servers in a chain each decide where a request ends, and if they decide differently, an attacker can hide a second request inside the first. The front server thinks it forwarded one request; the back server sees two. The hidden one can be aimed at a different destination than the visible one.

A denial of service (DoS) is an attack that makes a service unavailable rather than stealing data. Bug bounty programmes often reject DoS reports because the impact is considered low.

A bug bounty platform is a website where security researchers report bugs to companies and get paid if the bug is valid. The platform's staff, called triagers, read the report, try to reproduce the bug, and decide its severity. HackerOne, Bugcrowd and Intigriti are named in this story.

A proof of concept (PoC) is a small, repeatable demonstration that a bug is real, usually a request or a script plus the response it produces.

Burp is a tool researchers use to intercept and edit web traffic. Its "target" setting says which address the traffic should go to; if that is wrong, the test goes to the wrong place and fails.

curl is a command-line program for sending HTTP requests. A "one-liner" is a single command that reproduces the whole attack.

The clue: a header that came back

Akamai sits in front of a large number of customer websites as a reverse proxy and CDN. What interested the researchers was how Akamai's edge, the part of the network closest to the user, handled the Connection header, and specifically what happened when a client sent Connection: Content-Length.

In a correct HTTP/1.1 implementation, the Connection header lists options that apply to that single connection, and a proxy is expected to strip them before forwarding. Here the header was being reflected back in responses on several servers under the Akamai network. That suggested the edge was doing something unusual with it.

From the original on blog.hacktivesecurity.com

The header still appeared in responses on a number of Akamai-fronted servers at the time of writing. That reflection was the thread they pulled.

The setup

There were no accounts, roles or special tooling involved in the discovery itself. The work was done by sending crafted HTTP requests at Akamai-fronted hosts and observing the responses.

Later, to demonstrate real impact, they needed a second host inside the Akamai network. They did not have one at first, and that gap shaped the rest of the research: without a second host of their own, how could they show that an attacker could redirect other users?

Finding it

Many readers will already have tried to force a backend to use Content-Length instead of Transfer-Encoding. The idea is to make the front server and the back server disagree about body size, which is the classic smuggling setup. Their first attempts along those lines did not work: any attempt to abuse the Connection header with Content-Length as its value in order to perform a request smuggling attack failed.

What they did notice were unusual responses coming back from Akamai, for example:

From the original on blog.hacktivesecurity.com

And with www.example.com:

From the original on blog.hacktivesecurity.com

When they used the same host, the server returned different responses. As most people working in this area know, that alone is hard to attribute. It could be request smuggling, it could be HTTP pipelining (sending several requests back to back on one connection and getting the answers in order), or it could be ordinary server behaviour triggered by setting Connection to keep-alive, which simply asks the server to keep the connection open for the next request. The observation was interesting but not yet proof of anything.

Exploitation

Step 1: redirect requests between connections

Trying to redirect requests together with his co-worker, they found that it worked. At that point, however, all they had was a potential denial of service, and DoS reports are frequently rejected for lack of impact. To check whether they were looking at a genuine open desync (a real disagreement between two servers that anyone could trigger) rather than a local quirk, they repeated the tests from a different network. A different network rules out the possibility that something on their own side was causing the odd responses.

Step 2: find a second host inside Akamai

Only later did they discover that by inserting another host within the Akamai network they could redirect requests between the two of them, which finally gave them a complete request smuggling primitive. A primitive here means a working, repeatable building block of an attack.

This created a reporting problem. They had no host of their own inside the Akamai network, so how could they prove that an attacker could arbitrarily redirect users without logs to show? A bug report that says "trust me, it redirects" is weak; a report that shows a real file from a real second host appearing under the first host's address is strong.

Step 3: turn the desync into cache poisoning

As they kept trying, they were able to abuse the bug to arbitrarily cache content from other hosts. They also found that, in addition to GET, the OPTIONS method could be used to perform the attack. GET is the method a browser uses to fetch a page; OPTIONS is a method that asks a server which operations are allowed on a resource. With OPTIONS there was a better chance that Akamai would not notice the request was malicious.

To poison the cache, the sequence was:

  1. Send a first GET or OPTIONS request to a nonexistent path, preferably with a static resource extension so the response was more likely to be taken from the cache. A static resource extension is an ending like .txt or .js that suggests a fixed file rather than a generated page, and caches are more willing to store those. Using a nonexistent path also avoided causing damage to the platform, because there was no real page to overwrite.
  2. Send the second request to an arbitrary host.

After a couple of requests, the content of the second host's file was correctly cached because of its revalidation. Revalidation is the cache checking with the original server whether its stored copy is still current.

From the original on blog.hacktivesecurity.com

From then on it was possible to visit the URL /it/it/medusa.txt and receive the robots.txt of the second host:

From the original on blog.hacktivesecurity.com

robots.txt is a small file at the root of a website that tells search engines which pages they may crawl. It is harmless, which is exactly why they chose it: the point was to prove the mechanism without harming anyone. The content they chose to cache was not malicious, but many file types could be cached this way, including HTML and JavaScript. That gave them a solid impact for the report.

Step 4: the proof of concept

HTTP
OPTIONS /random.txt HTTP/1.1
Host: ORIGINAL-HOST
Connection: Content-Length
Content-Length: 42

GET /robots.txt HTTP/1.1
Host: ARBITRARY-AKAMAI-HOST
x: 1

Line by line:

  • OPTIONS /random.txt HTTP/1.1 is the first request line. The method is OPTIONS, the path is /random.txt, which does not exist on the target, and the protocol version is HTTP/1.1.
  • Host: ORIGINAL-HOST names the website the request is addressed to. In the real test this was a host behind Akamai.
  • Connection: Content-Length is the unusual note. It tells the receiving server that the header named Content-Length applies only to this connection. A correct proxy should strip this line before forwarding.
  • Content-Length: 42 says the body of this request is 42 bytes long. The body is the second request shown below, and 42 is the number of bytes the attacker claims it has.
  • The empty line ends the headers of the first request. Everything after it is treated as the body.
  • GET /robots.txt HTTP/1.1 is the hidden second request, sitting inside the body of the first. It asks for the robots.txt file.
  • Host: ARBITRARY-AKAMAI-HOST names a different website, also behind Akamai. This is the destination the attacker actually wants.
  • x: 1 is a dummy header. It is there to make the byte count work out and to give the second request a well-formed ending.

Sending this request twice made it possible to cache the contents of robots.txt from the second host.

Why it worked

The report does not describe the internal implementation, so the precise mechanism is not stated. Framing means deciding where one message stops and the next starts.

The attack worked with both GET and OPTIONS, and OPTIONS was less likely to be flagged as malicious. Not every Akamai host was vulnerable: some did not allow arbitrary content caching, probably because they had no cache or cache key settings that prevented the attack. A cache key is the label a cache uses to decide which stored copy matches which request; if the key is built in a way that separates hosts properly, the poisoning step fails even when the desync is present. They suspected a general misconfiguration rather than a per-customer one, which is why they also reported it through bug bounty platforms.

What an attacker could do with it

An attacker able to reach a vulnerable Akamai-fronted host could redirect requests between connections, which in their testing amounted to a potential denial of service on its own. With a second host inside the Akamai network, the desync became a full request smuggling primitive, and it could be used to poison the cache with arbitrary content chosen by the attacker, including HTML and JavaScript. In everyday terms: a visitor types a trusted company's address and receives a page the attacker wrote.

Disclosure and handling

As soon as the discovery was made they started responsible disclosure, reporting the vulnerability to Akamai. Responsible disclosure means telling the affected company privately and giving it time to fix the problem before saying anything publicly. They did not receive immediate confirmation. While they waited, they noticed that not all Akamai hosts were vulnerable, or some did not allow arbitrary content caching, and they decided to report it on bug bounty platforms as well.

  • HackerOne: after a very short time the triagers were able to replicate and understand the vulnerability and assigned the right severity.
  • Bugcrowd: many triagers were unable to replicate it despite a curl one-liner, a video PoC and screenshots. Some did not put the two blank lines in the GET requests, others had wrong Burp targets, and they also received duplicated (?) responses, like:
From the original on blog.hacktivesecurity.com

A wrong Burp target sends the request to the wrong server, which also cannot reproduce anything.

  • Microsoft: replied very late, saying it could not replicate the vulnerability, by which time Akamai had already introduced the fix.
  • Apple: responded late and could not replicate it because of Akamai's fix. They were very kind and thanked the researchers by email, but no bounty was paid, and the researchers did not want one.
  • Intigriti: they only filed a bug; the triager was very nice and friendly but marked it as a duplicate.

The fix

Akamai took very little time to ship the security fix after the report. Any attempt to use the Connection header in an inappropriate way is now automatically blocked. Akamai gave them permission to make a public disclosure.

From the original on blog.hacktivesecurity.com

These are the checks the researchers suggest, written so that a beginner can follow the reasoning.

  • Send Connection: Content-Length to other Akamai-fronted hosts and check whether the header is reflected in the response. A positive result is the header appearing back in the response on a host that should strip it. This is the first clue, not the attack itself.
  • Repeat the two-request OPTIONS PoC against a host with a cacheable static path. A positive result is the second host's file being served from the first host's URL after a couple of requests.
  • Try GET instead of OPTIONS where OPTIONS is blocked or filtered. A positive result is the same cached cross-host content.
  • Test hosts that appear not to be vulnerable, checking whether they have a cache and how their cache keys are configured, since the absence of caching prevents the poisoning step even when the desync is present.
  • Repeat the desync tests from a different network to distinguish a genuine open desync from local behaviour.

Glossary

  • Akamai: a company that runs a large network of servers placed in front of customer websites to speed them up and protect them.
  • API: a defined way for one program to ask another program to do something, like a service counter with fixed rules for what you can request.
  • Body: the part of an HTTP message after the blank line that carries the actual content, such as form data or a hidden request.
  • Bug bounty platform: a website where researchers report bugs to companies and receive payment for valid findings; its staff are called triagers.
  • Burp: a tool for intercepting and editing web traffic, with a target setting that decides where requests are sent.
  • Cache: storage that keeps copies of files so they can be served quickly to many users.
  • Cache key: the label a cache uses to match a stored copy to an incoming request.
  • Cache poisoning: putting attacker-chosen content into a cache so other users receive it.
  • CDN (content delivery network): a worldwide set of servers that keep copies of website files close to users.
  • Connection header: an HTTP header listing options that apply only to one connection; proxies are supposed to remove it before forwarding.
  • Content-Length: an HTTP header giving the size of the body in bytes.
  • Cookie: a small piece of data a website stores in your browser so it can recognise you on later requests.
  • curl: a command-line program for sending HTTP requests.
  • Denial of service (DoS): an attack that makes a service unavailable rather than stealing data.
  • Desync: a state where two servers in a chain disagree about the state of a connection, such as where one request ends.
  • Edge: the part of a CDN network closest to the user.
  • Framing: how a protocol decides where one message ends and the next begins.
  • GET: the HTTP method a browser uses to fetch a page or file.
  • Header: a line of extra instructions attached to an HTTP request or response.
  • Hop-by-hop: applying only to one link in a chain of servers, not to the final destination.
  • HTTP: the language browsers and servers use to exchange requests and responses.
  • HTTP pipelining: sending several requests back to back on one connection and receiving the answers in order.
  • keep-alive: a request to keep a connection open for further requests.
  • Method: the word at the start of an HTTP request line, such as GET or OPTIONS, saying what kind of action is wanted.
  • OPTIONS: an HTTP method that asks a server which operations are allowed on a resource.
  • Origin: the real website behind a proxy or CDN.
  • Proof of concept (PoC): a small, repeatable demonstration that a bug is real.
  • Request smuggling: an attack where two servers disagree about where a request ends, letting an attacker hide a second request inside the first.
  • Responsible disclosure: telling an affected company privately and giving it time to fix the problem before going public.
  • Reverse proxy: a server that stands in front of a website and passes requests through to it.
  • Revalidation: a cache checking with the original server whether its stored copy is still current.
  • robots.txt: a small file at a website's root telling search engines which pages they may crawl.
  • Severity: a rating of how serious a bug is.
  • Static resource extension: a file ending such as .txt or .js that suggests a fixed file rather than a generated page, making caching more likely.
  • Token: a piece of data used to prove identity or permission, often sent in a header or cookie.
  • Transfer-Encoding: an HTTP header saying the body arrives in labelled pieces, an alternative to giving a fixed Content-Length.
  • Triager: platform staff who read a bug report, try to reproduce it and rate it.
  • Vulnerability: a weakness in software or configuration that an attacker can use.

More by Francesco Mariani

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Request smuggling and header injection

The lesson behind this report.

A front end and a back end split one connection's bytes into requests differently, letting an attacker hide a request inside another user's.