# Shop App - Attacker is able to intercept authorization code during authentication (OAuth) and is able to get access to Microsoft Outlook email account

Shop App's Outlook OAuth used a custom deep-link scheme without PKCE, letting a malicious app intercept the authorization code and read the victim's email.

- Payout: $900
- Severity: low
- Program: Shopify
- Found by: kun_19
- Disclosed: 2023-03-02
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/1700734
- Library page: https://bugbountylibrary.com/r/h1%3A1700734
- Tags: area:mobile domain:mobile impact:ato impact:data-leak kind:bounty platform:hackerone sev:low tech:oauth technique:recon vuln:account-takeover vuln:auth-bypass vuln:info-disclosure

**Target:** Android/iOS mobile app OAuth deep-link callback (shopapp://) for Microsoft Outlook
**Root cause:** The Outlook OAuth flow delivered the authorization code via the custom scheme shopapp:// without PKCE, so any app registering the same scheme could receive the code and exchange it for a token.
**Steps:**
1. Install malicious Android app registering the shopapp:// scheme.
2. Install official Shop App and create an account.
3. Start connecting a Microsoft Outlook account in Shop App.
4. Log in to Microsoft and grant email read permissions.
5. Android shows app chooser; select the malicious app to receive the authorization code.
6. Exchange the intercepted code for a Microsoft session token, or POST it to https://server.shop.app/graphql operation LinkOutlookAccount.
**How found:** Recognized that mobile deep links are inherently insecure (no centralized scheme registration) and that the Outlook OAuth flow lacked PKCE, making the intercepted authorization code directly exchangeable.
**Exploitation:** Attacker registers the same custom URL scheme; on Android the user picks the malicious app in the chooser (on iOS first-come-first-served favors the malicious app if installed first). The intercepted authorization code is exchanged for a Microsoft token granting email read access, or linked to the attacker's Shop account via the LinkOutlookAccount GraphQL operation to track orders.
**Insight:** When auditing mobile OAuth, check whether the redirect uses a custom scheme and whether PKCE is enforced; a captured code without a code_verifier is directly redeemable, and on iOS scheme hijack wins if the malicious app is installed first.

