Repository navigation
Closed
Description
Split from #483 (part 2). security/sri reports scripts that the store owner cannot pin, because the platform or vendor updates them in place. SRI_EXEMPT_HOSTNAMES already exempts this class for Stripe, PayPal, GTM, GA and Facebook, but only by hostname, and the rule docs tell users to disable the rule for any other self-updating script.
Reported on a real Shopify store (squirrel 0.0.103), security/sri flagged "7 cross-origin resources without Subresource Integrity", including:
https://cdn.shopify.com/shopifycloud/shop-js/modules/v2/loader.init-shop-cart-sync.de.esm.js(injected by Shopify)https://cdn.shopify.com/storefront/standard-actions.js(injected by Shopify)https://cdn.shopify.com/extensions/<uuid>/<app>/assets/<name>-latest.js(theme app extension, path ends in-latest)https://static.klaviyo.com/onsite/js/<id>/klaviyo.jshttps://plausible.io/js/script.pageview-props.revenue.tagged-events.js
squirrel audit https://www.alpensattel.de/ -m 8 --http --offline --disable-discovery-probes \
--rule-include security/sri -f json -o out.json -yNotes from triage:
- Exempting all of
cdn.shopify.comis not safe: it also serves versioned theme and app assets that can carry an integrity hash. Exempt by path prefix instead (/shopifycloud/,/storefront/). - A hardcoded vendor list goes stale, so the rule also gets a user option (
exempt_hosts) for hosts a site owner knows are self-updating. - A generic "unversioned URL means info" rule is deliberately not part of this issue: it would flip existing tests that use unversioned example URLs and changes what the rule means.
Acceptance Criteria
- Scripts under
cdn.shopify.com/shopifycloud/andcdn.shopify.com/storefront/are not reported at warning level bysecurity/sri - A rule option
exempt_hostslets a site exempt additional hostnames; it is documented and validated - A versioned third-party script without
integrityon another host is still flagged - A theme or app asset on
cdn.shopify.comoutside the exempt prefixes is still flagged -
docs/rules/security/sri.mdxlists the path-prefix exemptions and theexempt_hostsoption, and no longer says "eleven hostnames" if the count changes - Test: extend
packages/rules/tests/sri.test.tswith the two Shopify platform URLs above: not reported - Test: same file, a
cdn.shopify.comtheme asset URL with?v=: still reported - Test: same file, a versioned
cdn.jsdelivr.net/npm/[email protected]/x.js: still reported - Test: same file, a host listed in
exempt_hosts: not reported; a host not listed: reported - Existing
sri.test.tscases for the current exempt hostnames stay green - The PR description states whether the squirrelscan agent skill needs a change (the skill links to the rule pages, which are the reference, so usually none); if it does, a follow-up is filed against squirrelscan/skills
Activity
nc9 commentedon Oct 11, 2026
Reproduced on 0.0.108 with a local fixture page loading the three Shopify URLs from the issue (platform paths and a
-latestextension asset), a theme asset with?v=and a versioned jsDelivr script:security/sri, checksri,warn,5 cross-origin resource(s) without Subresource Integrity, all five listed.origin/main still has this:
packages/rules/src/security/sri.tsexempts by hostname only (SRI_EXEMPT_HOSTNAMES, no Shopify entry, no path prefixes) and has noexempt_hostsoption.fix(rules): security/sri exempts Shopify platform scripts and adds ex…
fix(rules): security/sri exempts Shopify platform scripts and adds ex…