AI pentesting guides / By tech stack

Stack guide: Shopify

Shopify app security testing

Shopify app security testing focuses on your app's backend, not Shopify itself: the app holds access tokens for every merchant that installed it, so the critical questions are whether the install flow, session tokens and webhooks are verified, and whether one merchant can ever reach another merchant's data.

Shopify publishes detailed guidance for each of these checks. Most findings come from skipping one of them during development and never adding it back.

Installation and OAuth

  • The install callback must verify Shopify's HMAC over the query parameters before trusting the shop parameter.
  • The shop value should match a valid myshopify.com hostname; otherwise the app can be pointed at an attacker's host.
  • A state nonce must be generated and checked to prevent OAuth CSRF.
  • Requested scopes should be the minimum needed, because a stolen token carries all of them.

Webhooks, app proxies and session tokens

Shopify's documentation says to verify the X-Shopify-Hmac-SHA256 signature on HTTPS webhooks before processing, using the raw body. A common bug is body-parsing middleware that runs first and breaks verification, which then gets disabled. App proxy requests carry their own signature that also needs checking. For embedded apps, the session token from App Bridge is a JWT that the backend must verify (signature, audience, expiry) rather than decode.

Multi-tenant isolation

  • Every database query should be scoped to the shop from the verified session, never from a parameter the client sends.
  • Object IDs in app endpoints (orders, customers, settings) should be tested across two development stores.
  • Mandatory compliance webhooks (customer data requests and redaction, shop redaction) need to be implemented and verified.
  • Embedded apps need a frame-ancestors policy limited to the merchant's admin.
With Pentest-Swarm

Testing a Shopify app with Pentest-Swarm

Pentest-Swarm tests your app's own backend over HTTP. Keep scope to your app's hosts only: Shopify's platform is not yours to test outside its bug bounty programme.

  • Install the app on two development stores and give the swarm a session for each, using --header or --cookie, to test cross-store access.
  • Run api-security against your app backend to test BOLA and function-level authorisation on app endpoints.
  • Point it at the webhook and app proxy routes to check that unsigned or mis-signed requests are rejected.
  • Set --scope to your app's domain so nothing reaches Shopify hosts.

Where it falls short

Black-box testing cannot see how access tokens are stored or which scopes are used in code, and it cannot complete OAuth flows that need a merchant to click through without help. Review token storage and encryption separately, and keep Shopify's library versions current.

Questions

Can I pentest Shopify itself while testing my app?

Only within Shopify's bug bounty rules. Your own app's backend is yours to test; keep Shopify's hosts out of scope.

What is the most serious Shopify app bug?

Cross-store data access: one merchant, or an attacker who installs the app on their own store, reaching another merchant's data or tokens.

Why does webhook HMAC verification keep failing?

Usually because a JSON body parser has already consumed and re-serialised the body. Verify against the raw request bytes.

Sources

  1. Shopify: Verify webhook deliveries