Fresca Soda
Fresca soda was a pretty neat HTTP Request Smuggling challenge.
Last updated
Fresca soda was a pretty neat HTTP Request Smuggling challenge.
Last updated
The main goal here is to to leak the Fresca Soda secret receipt by acessing /receipt. If we try to access directly we, obviously, fail.
if we pay attention to the response header we'll see it's served with gunicorn and haproxy, so would be nice to look for desync vulns.
The version 20.0.4 of gunicorn is vulnerable to TE.CL desync, which means we can poison the server's sockets to tamper other users requests.
The server also has the /back route that redirects the client to the request's host header. If we put together a chain with what we've got so far, we could turn the /back redirect into an open redirect.
The server also has this wierd behavior that allows one to bypass the 403 on /receipt, if we request receipt (without /) otr //receipt (double /) The restrictions are bypassed, probably due to some poor regex.
The server returns 200 but we can't see the flag yet because we need a special header. A nice way of obtaining this header would be to poison thge socket to redirect one of the admins to our server so we can extract the header and replay our request with the secret header.
If we send the request above we'll be able To consolidate our poisoned request, which is:
With the next request to the server, so the victim's would look like the following when parsed by the server:
:9001 is not the actual port of the redirection, it will actually redirect to port 80, the reason is that the servers does a wierd thing to the Location header of the redirection when we have 2 Host headers but appending a dummy port number fixes it.
After sending the payload, whenever an admin browses to the site they will be redirected to my server and potentially leaking the header we need :)
Great! Now it's only a matter of using this header with our previous 403 bypass to dump the flag.
The final request looks like the following:
Finally, the server responds with the flag.