Skip to content

security/leaked-secrets: Shopify platform tokens (wallet JWTs, Shop sessions JWT, portable-wallets key) flagged on 37% of Shopify stores #1287

Closed

Description

@nc9

security/leaked-secrets flags tokens that Shopify itself puts on every storefront. So on most Shopify stores, a merchant who did nothing wrong gets a leaked-secret finding.

In a ~38k-site batch on v0.0.141, 37% of real Shopify stores got a leaked-secrets flag (36,000 non-Shopify sites: about 5%). Of the 213 flags on 77 stores, nearly all were Shopify's platform tokens:

source flagged as what it is
page HTML, wallet config "auth":[{"jwt":"eyJ…"}] (115 flags) JSON Web Token per-request payment-wallet token. Payload claims: iat, merchantId, merchantOrigin; carries expiresAt. Re-fetching returns a different token every time (all 115 "not present" on re-fetch).
page HTML near shopifyinc.com/sessions JSON Web Token Shop sessions client token (claims client_id, client_account_id, unique_id, iat)
/cdn/shopifycloud/portable-wallets/latest/portable-wallets…js (66 flags) Generic API Key Assignment Shopify's own wallet bundle, identical on every store
other /cdn/shopifycloud/… bundles (8) Generic API Key Assignment Shopify platform code

Separately, Shopify App Store listing pages (apps.shopify.com/<app>) carry a public api-key attribute that was flagged about 500 times across launches that point at their App Store listing.

Acceptance Criteria

  • JWTs whose decoded payload is the Shopify wallet shape (merchantId + merchantOrigin) or the Shop sessions client shape (client_id + unique_id, shopifyinc.com/sessions context) are classed public-by-design and not reported (fixtures from a storefront page).
  • Assignments inside scripts served from /cdn/shopifycloud/ (Shopify's platform bundles, same bytes on every store) are not reported. A test pins portable-wallets. (amended 2026-11-01: this covers an apiKey assignment in scripts served from cdn.shopify.com/shopifycloud/ and from /cdn/shopifycloud/ on a *.myshopify.com host, which are the hosts where the path proves the bytes are Shopify's; a store on a custom domain serving the same path is not skipped, so a real secret there still reports; documented in the rule docs.)
  • The api-key attribute on apps.shopify.com listing pages is not reported.
  • A real secret on a Shopify store (e.g. an Admin API shpat_ token or a third-party sk_live_ in a theme asset under /cdn/shop/) is still reported (fixture).
  • The rule docs list Shopify platform tokens under public-by-design.

Activity

  1. added
    bug
    on Oct 29, 2026
  2. added theissue type on Oct 29, 2026
  3. added
    size: M
    rules
    security
    on Oct 29, 2026
  4. nc9 commented on Nov 1, 2026

    @nc9
    ContributorAuthor

    Note on the Shopify Admin token criterion: a bare shpat_, shpca_, shppa_ or shpss_ token (32 hex) has no detector on main today (it is only reported under a generic key name). The detector arrives in the stack's #1318 (#1309), so this criterion is satisfied by the stack rather than by #1300 alone.

    nik

  5. nc9 commented on Nov 1, 2026

    @nc9
    ContributorAuthor

    Amended the /cdn/shopifycloud/ criterion to the shipped behaviour: an apiKey assignment in scripts served from cdn.shopify.com/shopifycloud/, or from /cdn/shopifycloud/ on a *.myshopify.com host, is skipped. A path alone is not enough on a custom domain: the rule docs and a test say so. All criteria are now met on v0.0.158 (wallet and Shop sessions JWTs public, apps.shopify.com, shpat_/shpca_/shppa_/shpss_ and a third-party sk_live_ still reported, docs). Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.158

    nik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugrulessecuritysize: M

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions