wtf( )unctionsystem design, drawn
← all problemsCachingHard

One request, and everyone got the attacker's page

The origin builds absolute URLs from a forwarded host header, because that is how it knows what it is called from behind the proxy.

The edge files entries by method and path. A single request carrying a different value for that header produced a response with somebody else's domain baked into it, and the edge stored that response under the ordinary, clean key. Every visitor afterwards was served it.

Make the header either part of the key or absent from the request.
Components — tap one, then tap a slot on the diagram
!For four hours every visitor loaded a script from a domain we do not own. One request put it there.

Boundaries, outermost first: Edge: Filed by method + path (FAILED: one key, two inputs) Outside every boundary: Everyone else (ordinary requests), One request (a forged header), Origin (reflects the header), an empty slot for the before the origin sees it, an empty slot for the what the entry is filed under Connections: One request calls Filed by method + path — one clean-looking key (step 1) Filed by method + path controls before the origin sees it — on the way out before the origin sees it calls Origin (step 2) Origin calls Filed by method + path — the body it built (step 3) Filed by method + path calls Everyone else — served to everyone (step 4) what the entry is filed under controls Filed by method + path

Everyone elseordinary requests
One requesta forged header
Originreflects the header
Filed by method + pathone key, two inputs