Random ramblings in Infosec

today i will write about a serious vulnerability i’ve found recently in Twitter.
so let me share the story with you .

the story started when i saw Twitter introducing their new bug bounty program and starts paying monetary rewards , i decided to look for new bugs in Twitter and get paid.

at the first moment of hunting i’ve successfully found a csrf vulnerability that can add many followers in single request and bypass the csrf token protection but unfortunately it was duplicate issue .

i started looking again for some more critical bugs and i successfully found a serious logical vulnerability [insecure direct object reference] in ads.twitter.com that allowed me deleting credit cards from any Twitter account.

the impact of the vulnerability was very critical and high because all what’s needed to delete credit card is to have the credit card identifier which consists only of 6 numbers such as “220152”.

so imagine a blackhat hacker that could write a simple python code and use a simple for loop on 6 numbers he could delete all credit cards from all twitter accounts which will result in halting all the twitter ads campaigns and incur big financial loss for Twitter .

so what was the vulnerability and where it exists ?

Actually i found two vulnerabilities not one but both was having the same effect and impact.

#First Vulnerability

the first vulnerability i had spotted was in the delete functionality of credit cards in payments method page

account: the twitter account idid: the credit card id and it’s numerical without any alphabetic characters

all i had to do is to change those two parameters to my other twitter account id and credit card id , then reply again the request and i suddenly found that credit card have been delete from the other twitter account without any required interaction .

the funny part that the page response was “403 forbbiden” but the credit card was actually deleted from the account

#Second Vulnerability

i’ve found another similar vulnerability but this time the impact was higher than the previous one.
when i tried to add an invalid credit card to my twitter account it displayed an error message“we were unable to approve the card you entered” and show a button called “Dismiss”

when i pressed on the Dismiss button the credit card was disappeared from my account , so i thought it have the same effect of deleteing , so i tried to add invalid credit card again and intercepted the request which looks like the following :