Weak rate limit could lead to ATO due to weak password protection mechanisms
The login endpoint returned a throttling error after repeated failed attempts, but still allowed successful login with correct credentials during the throttle period. Combined with a weak minimum password length of five characters and no special character requirement, this made brute-force account takeover easier.
- Triaged in 6 days
- Fixed in 12 days
- Paid in 12 days
- Disclosed after 12 months
Summary:
Although the server sends a message when attempting to brute force the login endpoint, if you enter the right credentials the server will ignore that error and will give access to the account. When the server sends this error, it should not give access until the 3400+ seconds ends Additionally, when you create an account the minimum password length is just 5 characters with no especial characters
HTTP/1.1 200 OK
Date: Wed, 23 Dec 2020 14:40:53 GMT
Content-Type: application/json; charset=utf-8
Connection: close
Set-Cookie: __cfduid=d191afcbe4c1251f6b30748328b1fb38e1608734453; expires=Fri, 22-Jan-21 14:40:53 GMT; path=/; domain=.dubsmash.com; HttpOnly; SameSite=Lax; Secure
X-Powered-By: Express
Access-Control-Allow-Origin: *
Cf-Ipcountry: US
Etag: W/"1c6-rSeAGxcTYF4pPpzI2dToH9KSAN0"
Via: 1.1 vegur
CF-Cache-Status: DYNAMIC
cf-request-id: 0731a4c556000003dc4b098000000001
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Strict-Transport-Security: max-age=0; includeSubDomains
X-Content-Type-Options: nosniff
Server: cloudflare
CF-RAY: 6062d71bbfa503dc-ORD
Content-Length: 454
{"errors":[{"serviceError":{"status_code":429,"message":"Request was throttled. Expected available in 3414 seconds.","error_code":1},"message":"Request was throttled. Expected available in 3414 seconds.","locations":[{"line":2,"column":3}],"path":["loginUser"],"extensions":{"code":"INTERNAL_SERVER_ERROR","exception":{"status_code":429,"message":"Request was throttled. Expected available in 3414 seconds.","error_code":1}}}],"data":{"loginUser":null}}
Impact:
This can lead to account takeover since the password limit to create an account is 5 and it doesn't need any especial characters, which can be chained to fully compromised an user, and easier for an attacker to perform a bruteforcing attack
Steps To Reproduce:
1 -> Go to the login page at https://dubsmash.com/login?redirect=/ supply any wrong credentials and send that request to burp using burp repeater.
It should look like this.
POST /graphql HTTP/1.1
Host: gateway-production.dubsmash.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://dubsmash.com/login?redirect=/
content-type: application/json
X-Dubsmash-Device-Id: 00a0ee27-a0e3-4701-9e25-5985f1d95c60
X-Accept-Content-Language: en_US
Origin: https://dubsmash.com
Content-Length: 622
DNT: 1
Connection: close
{"operationName":"LogInUserMutation","variables":{"username":"[email protected]","password":"password","client_id":"o80K4ofRjCcqdvIxaUVefAPCcnZAyJv4","client_secret":"mYrjmUEG47w2Wk6Kwe8wax1vAdiwUxEi"},"query":"mutation LogInUserMutation($username: String!, $password: String!, $client_id: String!, $client_secret: String!) {\n loginUser(input: {username: $username, password: $password, grant_type: PASSWORD, client_id: $client_id, client_secret: $client_secret}) {\n user {\n uuid\n username\n __typename\n }\n access_token\n refresh_token\n token_type\n __typename\n }\n}\n"}
2 -> Send that same request multiple times until you get an error saying Request was throttled. Expected available in 3000+ seconds
3 ->Supply my credentials username: ███████ password:████████
You should be able to access my account even though the server said request were 'throttled'
Impact
This could lead to account takeover since the password limit to create an account is 5 and it doesn't need any especial characters, which can be chained to fully compromised an user, and easier for an attacker to perform a bruteforcing attack.
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 rate-limiting mechanism only blocked incorrect credentials but did not enforce the throttle on successful authentication, and the password policy was too weak.
Impact
This could lead to account takeover because the weak password policy (minimum 5 characters, no special characters) makes brute-forcing easier, and the rate limit does not prevent successful logins during the throttle period.
What the attacker needed
A valid username and password; ability to send HTTP requests
The fix
The server should not grant access during the throttle period, and the password policy should be stronger.
How it was found
- Go to the login page and submit any wrong credentials, then capture the request in a proxy tool.
- Send the same request repeatedly until a throttling error appears.
- Supply valid credentials and observe that access is granted despite the throttle.
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.
A rate limit is supposed to slow down or block repeated login attempts to stop attackers from guessing passwords. Here, the server said 'too many requests, wait 3414 seconds', but when the correct password was sent, it let the user in anyway. Also, accounts could be created with very short passwords, making guessing easier.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.