Tracking of users on third-party websites using the Twitter cookie, due to a flaw in authenticating image requests
A privacy flaw in Twitter's image hosting allowed an attacker to identify a user by loading a private message image on an attacker-controlled site. The image URL was cookie-authenticated and only accessible to the two conversation participants, so if it loaded, the attacker knew the visitor's identity.
Originally disclosed on HackerOne
- Triaged in 2 days
- Fixed in 6 months
- Paid in 25 days
- Disclosed after 10 months
Summary: As part of our (SoftwareLab@TU Darmstadt) latest research project, we discovered a privacy-related vulnerability in multiple high-profile websites, including Twitter. An attacker exploiting this vulnerability can identify a user of your website while the user visits an attacker-controlled website, using the cookie you set in his or her browser. We call this vulnerability LeakyImages and below we describe the threat model, the exploit vector and the actual steps that need to be followed on your website to setup a LeakyImage between the attacker and the victim.
Description: Threat model: The attacker knows the victim’s ID/username on your website and she aims at identifying the user when visiting one of the websites she controls, such as a blog or a news website. Another flavor of this goal: the attacker wants to identify a user out of a group of potential target users. Moreover, she would like to link together user accounts created by the victim on different vulnerable websites. For example she would like to know that the visitor of the website has the email address [email protected] and the facebook account facebook.com/johndoe1973.
Exploit: The main insight of our exploit is that the attacker can use your platform to share an image “http://yoursite.com/myCuteCatImage.png” with the victim, so that the image is only accessible by the attacker and the victim. It is important that there is a cookie-based access control mechanism that enforces this former constraint. Since images are exempted from the same origin policy, when the victim visits an attacker-controlled website, the attacker instructs the victim’s browser to request this image. By checking whether the image gets loaded, the attacker can precisely identify whether the victim is the current visitor. In a sense, the attacker is able to setup a tracking pixel using your website and the reachability of this pixel leaks the identity of the user.
Steps To Reproduce:
- The attacker writes a private message to the victim which contains the image.
- Right click on the image + copy image address
- This URL is a cookie-based authenticated URL which only allow access to the image for the two participants in the conversation. For example the URL https://ton.twitter.com/1.1/ton/data/dm/971042231900622855/971042220110426113/dsxFPPP0.jpg:large can only be accessed by the users CrisStaicu and johndoevici1988.
Impact:
The attacker can include the LeakyImage in a page he controls. If the image is correctly loaded, the Twitter identity of the current visitor is leaked.
Closing Remarks:
We believe that the described attack is a serious threat to the privacy of your users. We are looking forward to hearing from you and we would like to share further details if needed to aid in fixing the reported problem. We plan to publish a description of the vulnerability at an academic security conference and notify you as part of a responsible disclosure process. We will be happy to coordinate any public release of this information with you, and in turn, would be happy to receive feedback on whether and when you plan to address the problem.
Impact
An attacker exploiting this vulnerability can identify a user of your website while the user visits an attacker-controlled website, using the cookie you set in his or her browser.
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 image URLs were protected only by a cookie-based access check, and because images are not subject to the same-origin policy, an attacker could embed the URL on a third-party site and detect whether it loaded.
Impact
The attacker can include the image on a page they control; if it loads, the visitor's Twitter identity is leaked.
What the attacker needed
Attacker knows victim's Twitter ID; victim visits attacker-controlled site; victim is logged in to Twitter
How it was found
- The attacker sends a private message to the victim containing an image.
- The attacker copies the image address from the message.
- The copied URL is a cookie-authenticated link that only the two conversation participants can access.
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 log into a website, your browser stores a small piece of data called a cookie, which proves who you are. Some image links only work if that cookie is present. The researchers found that an attacker could put such an image link on their own website; if the victim's browser loaded the image, the attacker knew the victim was logged in and could link that visit to their account.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.