CSRF token fixation in facebook store app that can lead to adding attacker to victim acc
The Facebook Store app for Shopify used a fixed OAuth state parameter that never changed between authorisation attempts. An attacker who learned that value could craft a link that connects their own Facebook account to a victim's Shopify account.
- Triaged in 10 days
- Fixed in 59 days
- Paid in 59 days
- Disclosed after 2 months
Summary by the researcher
haha sorry for the template @pranav_hivarekar:p
The report
hey guys
i just found an csrf token fixation in facebook store app which is an offical shopify app
link >> https://docs.shopify.com/manual/more/official-shopify-apps/facebook-store
The CSRF bug which connects attacker's Facebook account to victim's shopify account. This is done by exploiting 'Connect with Facebook' function.
When using 'Connect with Facebook' function. A request is sent to facebook to authorize the shopify app. After authorizing a 'access token' is sent in response which shopify app verifies and connects the account. the verification is done by csrf token "state parameter "
here state parameter is getting fixed here
1st oauth request
then when it autorized , we will get this get !
now how many times you autorize the state parameter will be same ! once the attacker gets state parameter by xss or any method , he can make csrf lifelong posible
exploit code
<html>
<body>
<a href=https://facebookstore.shopifyapps.com/authenticated?code=[[attacker_token ]&state=c2f449f2df5ee64df6173702846bce72e3a57319#_=_>
</body>
</html>
hope this bug will be fixed soon
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 OAuth state parameter was a hard-coded or static value rather than a fresh random value per session, so it could not bind the callback to the victim's own request.
Impact
An attacker who obtained the static state value could link their own Facebook account to a victim's Shopify account.
What the attacker needed
Attacker learns the static state value; victim clicks a crafted link
How it was found
- Start the 'Connect with Facebook' flow and note the state parameter in the authorisation request.
- Authorise the app and observe the callback returning the same state value.
- Repeat the flow and confirm the state parameter never changes.
- Send a crafted callback link containing the attacker's code and the fixed state to a victim.
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 click 'Connect with Facebook', the site sends you to Facebook and back, and it uses a random code called a state parameter to check the reply really belongs to your session. Here that code was always the same, so anyone who saw it once could reuse it to make the site link their own Facebook account to someone else's shop.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.