Security Policy
How Supplier Stock Sync protects merchants and their stores.
It only changes stock
- The app's one write to a store is setting inventory "available" quantities. Every Shopify call passes through one function that refuses any other mutation, so it cannot change products, prices, titles, tags, collections or metafields even if a future change tried to.
- Writes are compare-and-swap (Shopify refuses one if the stock moved since it was read) and carry an idempotency key, so a retry can never apply a change twice.
- Scheduled live writes stay off until the merchant has run a dry-run, read and accepted a responsibility notice, and switched them on.
- A run that would change more than a quarter of the compared stock levels, or set most of its changes to zero, is blocked until a person reviews it.
Keeping stores apart
- Every table that holds a store's data carries the store's id, and every query is made through a repository bound to one store. No other code may run database queries; a check in the test run enforces this.
- The database itself refuses cross-store links (composite foreign keys: a mapping cannot point at another store's supplier).
- A store's identity comes only from something Shopify signed: an App Bridge session token in the admin, or the HMAC on webhooks. Never from a request body or an unsigned query string.
- Automated tests try to read and change other stores' data through every route and must fail.
Credentials
- Shopify offline tokens are the expiring kind (one hour) with rotating refresh tokens. Both are encrypted with AES-256-GCM, with the store id bound as additional data, using a key held only as a Cloudflare Worker secret.
- Feed credentials are encrypted the same way, bound to the store and the feed, never shown again after entry, and only ever sent to the host they were entered for.
- Minimum scopes: read products, read and write inventory, read locations. No access to orders or customers.
- On uninstall the tokens are deleted immediately.
Supplier feeds
- HTTPS only. Private, local, link-local and reserved addresses are refused in every written form, and the runtime itself refuses non-public addresses.
- Redirects are not followed; responses are capped at 40 MB and 60 seconds; XML entity expansion is tightly limited.
- A feed whose data looks broken (missing SKUs, blank quantities) is refused as a whole and the backup feed is used. A valid quantity of zero is data, never a reason to fall back.
Requests
- Webhooks: HMAC-SHA256 verified in constant time, topic checked, each delivery id accepted once (replay protection across all stores).
- Admin: session token verified on every API call (signature, expiry, audience, shop); per-store rate limits, stricter for feed fetches, catalogue scans and exports.
- All input is validated (types, ranges, lengths, allowlists). All output is escaped; CSV files are protected against formula injection. Security headers include a strict Content-Security-Policy, HSTS and nosniff.
- No credentials, tokens or email addresses are written to logs.
Reporting a vulnerability
Email [security contact email]. Please include steps to reproduce. We aim to acknowledge within 3 working days. Please do not test against stores you do not own.