Defense-in-Depth · Shopify Admin GraphQL 2026-10

LedgerPO Security & Data Integrity Controls

Every inventory mutation, cost adjustment, and Stocky CSV export is engineered for auditability, idempotency, and minimal blast radius.

1. Least-Privilege PCD Level 0 & Cookie-Free Auth

LedgerPO runs embedded in Shopify Admin via Shopify-Managed Installation and App Bridge v4 signed session tokens—eliminating third-party cookies. Only 6 inventory/product scopes are requested; customer and order PII scopes are strictly excluded.

2. Idempotent Inventory Writes & Optimistic Locking

All receiving and stocktake writes invoke Shopify Admin GraphQL 2026-10 inventoryAdjustQuantities with @idempotent keys and changeFromQuantity optimistic checks so retries or concurrent sales never double-adjust stock.

3. Immutable Cost Ledger & 1-Click Rollback

Retroactive freight and duty allocations compute in 4-decimal BigInt micro-units using largest-remainder distribution. Corrections append immutable reversal entries rather than mutating historical ledger rows.

4. CSV Formula-Injection & ZIP Bomb Defense

All CSV exports neutralize leading =, +, -, @, fullwidth equivalents, and control characters before writing cells. Stocky ZIP extraction enforces strict compressed (64 MiB) and uncompressed (128 MiB) limits.

Air-Gapped Free Tool Verification (connect-src 'none')

The free browser inspector at /stocky-zip-inspector/ is served with an HTTP response header locking Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'none'; frame-ancestors 'none'. Even if JavaScript attempted an outbound fetch() or XMLHttpRequest, the browser engine blocks it at the network layer.

Webhook HMAC Verification & Graceful Permission Fallback

  • All Shopify webhooks (including customers/data_request, customers/redact, shop/redact, and app_subscriptions/update) undergo constant-time HMAC-SHA256 verification; invalid signatures are rejected with HTTP 401.
  • If a Shopify staff account lacks the “View product costs” permission (unitCost returns null), LedgerPO surfaces an inline banner and marks valuation status as COST_UNAVAILABLE without crashing.

Responsible Vulnerability Disclosure

To report a security issue or request security documentation, contact support@packdemo.com.