Skip to content
CSRF Disclosed report Intermediate

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.

defmax Follow

Originally disclosed on HackerOne

Bounty$500 View original
  • 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

https://graph.facebook.com/oauth/authorize?client_id=410312912374011&display=popup&redirect_uri=https%3A%2F%2Ffacebookstore.shopifyapps.com%2Fauthenticated&response_type=code&scope=manage_pages+email&state=c2f449f2df5ee64df6173702846bce72e3a57319

then when it autorized , we will get this get !

https://facebookstore.shopifyapps.com/authenticated?code=AQDdi9hS-WHa-jnVj3Cm63b_gc68E6vjm6xxoalbiwX0fmWtH91HdRI6vjkg2TmjGGJZcmQI4hHO1J8PC_CF7z5-vmxxaXjQQtBadOiwuYGPUrvpmsP2OkVAjFiLUzYDwn6O778zSz6Hb4nYlsW5OUz0QrdQLMY8aWTXKZnywzpQPz-Xx1q9DU4_mFotq7IaYgSvmbWDPNeM05FY4XCEKYIVKtB0Jpx2_hHG9ft_xXcAfh8sKnNzeEkgWrcGfqXnH-_h2EYvCB57gB0qj6ec7O-5SUlo6B4qPq4HywEqYaPXO2yj0npE9BkAJWjwCWMbeTw&state=c2f449f2df5ee64df6173702846bce72e3a57319#_=_

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

The original report as published on HackerOne, by defmax. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Start the 'Connect with Facebook' flow and note the state parameter in the authorisation request.
  2. Authorise the app and observe the callback returning the same state value.
  3. Repeat the flow and confirm the state parameter never changes.
  4. 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.

More by defmax

View all

7 more disclosed reports, best first.

More from Shopify

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.