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.
- 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
- Victim(mshop2-2) already has Pinterest account connected.
- Attacker(mshop3-2) doesn't have Pinterest account connected and attempts to connect a Pinterest account.
- Attacker authorize the shopify app to connect to his Pinterest account.
- Attacker intercepts the redirection back to
pinterest-commerce.shopifyapps.comand drop the request. Attacker also captures the URL, e.g.https://pinterest-commerce.shopifyapps.com/auth/pinterest/callback?code=d0c18854a3359866774d479614081453d235962f - Attacker induces Victim to load the above captured URL.
- 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.
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
- Victim already has a Pinterest account connected to their shop.
- Attacker starts connecting their own Pinterest account and authorises the Shopify app.
- Attacker intercepts the redirect back to the callback and captures the URL.
- Attacker makes the victim load the captured callback URL.
- 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.