Skip to content
CSRF Disclosed report Beginner

CSRF in Connecting Pinterest Account

The Pinterest account connection flow on Shopify lacked CSRF protection, so an attacker could capture their own OAuth callback URL and make a victim load it. This replaced the victim's linked Pinterest account with the attacker's account.

mercurii Follow

Originally disclosed on HackerOne

  • Fixed in 51 days
  • Paid in 51 days
  • Disclosed after 51 days

Hi,

The connect to Pinterest function is vulnerable to CSRF. This allows an attacker to connect his/her pinterest account to the victim's shopify. Even if the victim has already connected a pinterest account, this will allow the attacker to replace the existing connected pinterest account with the attacker's own pinterest account.

#PoC Note: I have also attached screenshots showing each step

  1. Victim(mshop2-2) already has Pinterest account connected.
  2. Attacker(mshop3-2) doesn't have Pinterest account connected and attempts to connect a Pinterest account.
  3. Attacker authorize the shopify app to connect to his Pinterest account.
  4. Attacker intercepts the redirection back to pinterest-commerce.shopifyapps.com and drop the request. Attacker also captures the URL, e.g. https://pinterest-commerce.shopifyapps.com/auth/pinterest/callback?code=d0c18854a3359866774d479614081453d235962f
  5. Attacker induces Victim to load the above captured URL.
  6. Victim's connected Pinterest account has been replaced with the attacker's Pinterest account.

#Possible Fixes

  • Make use of the state parameter in OAuth, which is used to prevent CSRF, when connecting to Pinterest.

The original report as published on HackerOne, by mercurii. 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 callback did not use or validate a state parameter, so the authorisation response could be replayed by a third party.

Impact

An attacker could replace a victim's linked Pinterest account with their own.

What the attacker needed

Victim has a Shopify shop; victim loads attacker-supplied URL; attacker has a Pinterest account

How it was found

  1. Victim already has a Pinterest account connected to their shop.
  2. Attacker starts connecting their own Pinterest account and authorises the Shopify app.
  3. Attacker intercepts the redirect back to the callback and captures the URL.
  4. Attacker makes the victim load the captured callback URL.
  5. The victim's connected Pinterest account is replaced with the attacker's account.

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 link one service to another, the site usually uses a one-time code in the URL to confirm it is really you. Here that confirmation step could be replayed by anyone, so an attacker could trick a victim into loading the attacker's own confirmation link. The victim's shop would then be linked to the attacker's Pinterest account instead of their own.

What is CSRF?

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

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.