Following a User After Favoriting Actually Follows Another User (related to #95243)
A parameter in a Twitter intent URL for favouriting a tweet was carried over into the follow action on the resulting page, so the user ended up following a different account than the one they intended. An attacker could craft a link that makes a victim follow an arbitrary account without their knowledge.
- Triaged in 2 days
- Fixed in 28 days
- Paid in 3 days
- Disclosed after 29 days
Hi,
There appears to be a bug similar to #95243 which affects following a user after favoriting one of their tweets via an Intent dialog.
The following is a proof of concept:
https://twitter.com/intent/favorite/?tweet_id=661625230297821184&screen_name=ericrtest3
The screen_name param submits with the favorite form and ends up getting injected into the follow param on the resulting page.
This isn't quite as bad as the previous vulnerability I found, since it requires an additional step (favoriting a tweet) to exploit. However, the impact is exactly the same as the last vulnerability, in that the user has no idea that they're actually following a completely different user.
Please let me know if you have any other questions.
What the report shows
The target is the Twitter (X) Intent dialog for favouriting a tweet, reached through the /intent/favorite/ endpoint. The researcher, ericr, found that a crafted intent URL could make a victim follow a different account than the one whose tweet they were favouriting. The report describes the issue as similar to an earlier report, #95243.
The proof of concept is a single URL:
https://twitter.com/intent/favorite/?tweet_id=661625230297821184&screen_name=ericrtest3
The screen_name parameter is submitted together with the favourite form. On the resulting page, that value ends up injected into the follow parameter. In other words, the account named in screen_name is not necessarily the account that gets followed after the favourite action completes.
The researcher is explicit that this is less severe than the earlier vulnerability, because it needs an extra step: the victim has to favourite a tweet. The impact, however, is described as exactly the same. The user has no idea that they are actually following a completely different user.
The report gives no severity rating, no CVSS score and no fix details. The platform records the weakness as UI redressing (clickjacking) and a bounty of 280.00 USD, disclosed on 2015-12-02.
Root cause
The report says the screen_name value is submitted with the favourite form and ends up injected into the follow parameter on the resulting page. It does not explain why. The favourite form and the follow parameter are handled as one flow, so a value supplied by the attacker in the URL survives into a state-changing request the victim did not intend to make.
Impact
An attacker can cause a victim who uses the intent dialog to favourite a tweet to end up following a completely different user. The report stresses that the victim is unaware of the follow. The report says the user has no idea they are following a completely different user. The report does not describe any further consequences, such as direct messages or timeline manipulation, and does not claim them.
How this kind of bug works
This is a parameter-injection problem in a multi-step UI flow. A page accepts several inputs, some from the URL and some from the form, and later reuses one of them in a different context. If the server trusts the URL-supplied value when building the follow request, the attacker controls who is followed while the victim believes they are only performing the visible action (favouriting).
The bug class sits between cross-site request forgery and UI redressing. The victim does perform the action themselves, so classic CSRF tokens do not help; the flaw is that the action's target is attacker-controlled. It happens when intent or dialog endpoints merge query parameters into the state-changing request without validating that they match the object the user acted on.
How to test for it
- Identify intent, dialog or share endpoints that perform a state-changing action, such as follow, like, favourite, retweet or subscribe.
- Note every parameter the endpoint accepts, especially ones that name a user, an object ID or a target account.
- Send a request where the object parameter (for example a tweet ID) belongs to one account and the user parameter names a second, attacker-controlled account.
- Complete the visible action in a test session and observe which account is followed, liked or otherwise affected.
- Repeat with the user parameter omitted, empty, duplicated, or supplied both in the query string and in the form body, to see which value wins.
A positive result is a state change on an account that does not match the object the victim acted on, with no additional confirmation shown. Common false positives are endpoints that display the mismatched value but never submit it, flows that require an explicit second confirmation, and cases where the server ignores the URL parameter entirely and uses the object's real owner.
How it is fixed
The report gives no fix details.
Hunting notes
These bugs tend to hide in intent, dialog and embed endpoints that chain two actions, and in older features where a form posts to a handler that also reads the query string. Recon signals include endpoints with both an object ID and a user or screen name parameter, redirects that append parameters, and any flow where the URL you land on after submitting contains values you supplied earlier. State clearly what extra step the attack requires, as this report does.
Difficulty
{"difficulty": "beginner", "difficulty_reason": "The bug is found by manipulating a single URL parameter in a known intent endpoint and observing the resulting follow action, requiring no special tooling."}
What happened, in plain words
Twitter (now X) has a feature called an Intent dialog. It is a small page that lets you do one action on a tweet without visiting the full site, for example favouriting (liking) a tweet. You reach it through a special web address, an endpoint, that starts with /intent/favorite/. Think of an endpoint as a specific counter in a large building: the address tells the browser exactly which counter to walk up to.
The researcher, ericr, found that a crafted intent address could make a victim follow a different account than the one whose tweet they were favouriting. The report says the issue is similar to an earlier report, #95243.
The proof of concept is a single web address:
https://twitter.com/intent/favorite/?tweet_id=661625230297821184&screen_name=ericrtest3
Line by line:
https://twitter.com/intent/favorite/is the intent endpoint for favouriting a tweet.?marks the start of the parameters, the extra pieces of information sent along with the address.tweet_id=661625230297821184names the tweet to be favourited. A tweet ID is the unique number that identifies one tweet, like a barcode on a product.&separates one parameter from the next.screen_name=ericrtest3names a user account. A screen name is the public handle of an account.
The report says the screen_name parameter is submitted together with the favourite form. On the resulting page, that value ends up injected into the follow parameter. In plain terms: the account named in screen_name is not necessarily the account that gets followed after the favourite action completes. The value you put in the address travels into a different part of the page and changes who is followed.
The researcher is explicit that this is less severe than the earlier vulnerability, because it needs an extra step: the victim has to favourite a tweet. The impact, however, is described as exactly the same. The user has no idea that they are actually following a completely different user.
The report gives no severity rating, no CVSS score and no fix details. The platform records the weakness as UI redressing (clickjacking) and a bounty of 280.00 USD, disclosed on 2015-12-02.
Root cause
The report says the screen_name value is submitted with the favourite form and ends up injected into the follow parameter on the resulting page. It does not explain why. The favourite form and the follow parameter are handled as one flow, so a value supplied by the attacker in the address survives into a state-changing request the victim did not intend to make. A state-changing request is any request that alters something on the account, such as following, liking or posting, as opposed to just reading a page.
Impact
An attacker can cause a victim who uses the intent dialog to favourite a tweet to end up following a completely different user. The report stresses that the victim is unaware of the follow. The report says the user has no idea they are following a completely different user. The report does not describe any further consequences, such as direct messages or timeline manipulation, and does not claim them.
In general, how this kind of bug works
This is a parameter-injection problem in a multi-step UI flow. A page accepts several inputs, some from the address and some from the form, and later reuses one of them in a different context. If the server trusts the address-supplied value when building the follow request, the attacker controls who is followed while the victim believes they are only performing the visible action (favouriting).
A useful comparison is a restaurant order slip. You tick "one coffee" on the form, but someone has already written a different table number in the margin of the slip. The waiter reads the margin and delivers the coffee to the wrong table, while you think you only ordered a coffee.
The bug class sits between cross-site request forgery and UI redressing. Cross-site request forgery (CSRF) is when another site silently makes your browser send a request you did not intend. UI redressing, also called clickjacking, is when a page is disguised so that what you click is not what you think you are clicking. Here the victim does perform the action themselves, so classic CSRF tokens do not help. A CSRF token is a secret value added to a form so the server can check the request really came from its own page. The flaw is that the action's target is attacker-controlled. It happens when intent or dialog endpoints merge address parameters into the state-changing request without validating that they match the object the user acted on.
In general, how to test for it
- Identify intent, dialog or share endpoints that perform a state-changing action, such as follow, like, favourite, retweet or subscribe.
- Note every parameter the endpoint accepts, especially ones that name a user, an object ID or a target account.
- Send a request where the object parameter (for example a tweet ID) belongs to one account and the user parameter names a second, attacker-controlled account.
- Complete the visible action in a test session and observe which account is followed, liked or otherwise affected.
- Repeat with the user parameter omitted, empty, duplicated, or supplied both in the address and in the form body, to see which value wins.
A positive result is a state change on an account that does not match the object the victim acted on, with no additional confirmation shown. Common false positives are endpoints that display the mismatched value but never submit it, flows that require an explicit second confirmation, and cases where the server ignores the address parameter entirely and uses the object's real owner.
In general, how it is fixed
The report gives no fix details.
In general, hunting notes
These bugs tend to hide in intent, dialog and embed endpoints that chain two actions, and in older features where a form posts to a handler that also reads the address parameters. Recon signals include endpoints with both an object ID and a user or screen name parameter, redirects that append parameters, and any flow where the address you land on after submitting contains values you supplied earlier. State clearly what extra step the attack requires, as this report does.
Glossary
- Endpoint: a specific web address that performs one function on a site.
- Intent dialog: a small Twitter page that lets you do one action on a tweet without visiting the full site.
- Parameter: an extra piece of information attached to a web address after a
?, written asname=value. - Tweet ID: the unique number that identifies one tweet.
- Screen name: the public handle of an account, such as
ericrtest3. - Injection: putting a value into one part of a system so that it is later used somewhere it was not meant to go.
- State-changing request: a request that alters something on an account, such as following, liking or posting.
- Root cause: the underlying reason a bug exists, as opposed to its visible symptom.
- UI redressing (clickjacking): disguising a page so that what you click is not what you think you are clicking.
- Cross-site request forgery (CSRF): another site silently making your browser send a request you did not intend.
- CSRF token: a secret value added to a form so the server can check the request came from its own page.
- False positive: a test result that looks like a bug but is not one.
- Recon: the early stage of looking around a target to find interesting endpoints and features.
- Severity rating: a score describing how serious a bug is.
- CVSS: a standard scoring system for the severity of security bugs.
- Bounty: a payment made to a researcher for reporting a valid bug.