Security Architecture

Security Statement

RestockPulse is designed from day one to minimize data exposure, enforce cryptographic authentication on every request, and isolate every merchant tenant.

1. Authentication & Token Lifecycle

  • Embedded Session Tokens (HS256): Every embedded Admin request is authenticated via App Bridge Session Token JWTs verified with constant-time HMAC-SHA256 (crypto.timingSafeEqual), validating audience, issuer, destination domain, and expiration.
  • Expiring Offline Tokens + Rotation: RestockPulse uses short-lived expiring offline Admin API tokens (expiring=1) with automatic refresh_token rotation—eliminating permanent static API keys.
  • Signed Session Cookies: Post-OAuth browser cookies are signed with HMAC-SHA256 and marked HttpOnly; Secure; SameSite=None. Unsigned ?shop= parameters are never trusted.

2. Webhook Integrity & Replay Protection

All incoming webhooks (GDPR compliance and operational topics) require a valid X-Shopify-Hmac-Sha256 header verified against the raw request body using constant-time comparison. Invalid signatures are immediately rejected with HTTP 401, and duplicate delivery IDs (X-Shopify-Webhook-Id) are deduplicated idempotently.

3. Multi-Tenant Isolation & Encryption

  • Tenant Scoping: Every database query in our forecast, importer, and purchase order repositories is strictly scoped by the authenticated shopId.
  • Encryption: All traffic uses HTTPS/TLS 1.3; all database storage on Neon PostgreSQL (AWS us-east-1) is encrypted at rest (AES-256).
  • Export Safety: All CSV exports neutralize spreadsheet formula injection prefixes (=, +, -, @), and printable purchase order documents escape all HTML entities with zero external network calls.

4. Vulnerability Disclosure

To report a security issue responsibly, email nuuuages@gmail.com with subject [SECURITY]. We acknowledge security reports within 1 business day.