All answers

The Prevailing
Answers for
Business model:
Business model, pick up to two

How do we keep a hacked third-party script from stealing card details at checkout?

The PrevailingPublished Nov 30, 2026

Our answer

Keep card entry in your payment provider's hosted checkout or iframe. Cut testing, analytics and ad tags from checkout unless one has a documented need. List every script left, limit them with a Content Security Policy and get change alerts.

Confidence
Medium
Strongest proof
8 official rules
2 datasets, 5 opinions or claims
Sources
9 sources
15 statements

New here? Take the 1-minute tour

Why this is the answer

4 reasons and our judgment

The Optimizely skimmer could read cards typed into a site's own form fields but not cards entered in a payment provider's hosted iframe (Report URI, a script monitoring firm). The code reached sites of 178 organizations through Optimizely's own scripts (BleepingComputer).

Embedding a processor's payment iframe still leaves a script check. To use SAQ A, the store must confirm its page resists script attacks, through its own controls or its processor's confirmation. Redirecting to the processor skips that test (PCI Security Standards Council).

Shopify runs checkout extensions and pixels in sandboxes. Extensions have no access to payment details or the checkout page itself. Custom pixels are yours to vet, since Shopify makes their code security your responsibility (Shopify).

A tight Content Security Policy stopped the attack where trusting the vendor did not. Of 159 affected organizations whose policies Report URI classified, 24 (15%) blocked the payload and 68 had no policy at all. Allowing Optimizely's own host gave no protection.

Our judgment

A hosted iframe is the first fix for a store running its own payment page, not the whole fix, because a script on the page around it can still show shoppers a fake card form. Shopify stores carry less of this job than stores running their own payment pages, but not none, since the custom pixels and apps they add are theirs to vet. For a marketing team that cannot risk breaking checkout, a Content Security Policy in Report-Only mode is the practical start, moving to enforcement once the reports show the list of allowed hosts is complete.

Our judgment, built from Cloud Security Alliance, Report URI, Shopify, cside and Adyen: our reading of these sources, not a finding from any one of them.

What the sources say

15 statements from 9 sources
  • AdyenUndatedSupports

    Adyen says PCI DSS rules 6.4.3 and 11.6.1 require payment pages to authorize, inventory and integrity check every script and alert on tampering. It suggests starting with a report-only CSP.

    “An inventory of all scripts is maintained with written justification as to why each is necessary.”

    Read it on docs.adyen.com

  • AdobeUndatedSupports

    Adobe Commerce and Magento 2.4.4-p9, 2.4.5-p8, 2.4.6-p6, 2.4.7, 2.4.8 and later add integrity hashes for local JavaScript on payment pages to meet PCI 4.0, but not for custom remote scripts.

    “there is no SRI support for custom remote Javascript resources currently”

    Read it on developer.adobe.com

  • ShopifyUndatedSupports

    Shopify says tracking pixels load through checkout and order pages, run in a sandbox that can't scrape email or phone, and in the EEA and UK fire only with the visitor's consent.

    “Pixels automatically load on the Storefront, Checkout, Thank you page, and Order status page.”

    Read it on help.shopify.com

  • ShopifyUndatedSupports

    Shopify says custom pixels, such as one running Google Tag Manager, are unsupported and need JavaScript skills. It suggests checking for an app first and testing with the Shopify Pixel Helper.

    “Adding and using custom pixels is unsupported by Shopify.”

    Read it on help.shopify.com

  • Cloud Security AllianceNov 18, 2026Supports

    A Cloud Security Alliance note on hacked Optimizely scripts that skimmed cards at checkout says only 24 of 159 organizations (15%) had a CSP that would have blocked them. It advises keeping marketing tags off checkout.

    “Allowlisting a vendor domain gave no protection, because the malicious code came from the trusted host.”

    Read it on labs.cloudsecurityalliance.org

  • Dark ReadingNov 17, 2026Supports

    Dark Reading reports attackers hid card-stealing code in Optimizely's customer script field, exposing visitors to sites of at least 178 organizations. Security vendors quoted say to recheck and limit vendor scripts.

    “a vendor approval is a point-in-time decision, and the risk changes every time that vendor's code changes”

    Read it on darkreading.com

  • Report URINov 17, 2026Supports

    Scott Helme, whose company sells script monitoring, says third-party scripts change often. Sites should drop unused ones, use SRI and CSP (Report-Only mode is a safe start) and watch for changes.

    “a CSP in enforce mode is better than a CSP in Report-Only mode, in the exact same way that a CSP in Report-Only mode is better than nothing at all.”

    Read it on scotthelme.co.uk

  • Report URINov 16, 2026Supports

    Report URI, a CSP monitoring vendor, says a card skimmer in Optimizely snippets hit 178 organisations. Of 159 it classified, 24 (15%) blocked it with a restrictive script-src and 68 had no CSP.

    “Cards entered in hosted payment iframes (Stripe, Adyen and similar) were out of its reach. Cards typed into a site's own form fields were not.”

    Read it on blog.report-uri.com

  • BleepingComputerNov 16, 2026Supports

    Attackers used an Optimizely signup flaw to inject card-skimming JavaScript into customer sites. A researcher found 188 infected scripts from 178 organizations among 1,611 scanned. Optimizely says it is fixed.

    “Searches for credit card numbers, expiration dates, and security codes entered into webpages”

    Read it on bleepingcomputer.com

  • Report URINov 13, 2026Supports

    Report URI, a script monitoring vendor, found a skimmer on tens of shops that adds a fake card form even where checkout redirects to a gateway or is cash on delivery. It says a tight script policy blocks it.

    “Your server never receives the card number and your payment provider sees normal, successful payments.”

    Read it on blog.report-uri.com

  • ShopifyOct 29, 2026Supports

    Shopify's checkout UI extensions can add messages, payment options or thank-you page surveys, but extensions in the information, shipping and payment steps need Shopify Plus.

    “Checkout UI extensions for the information, shipping, and payment steps are available only to stores on a Shopify Plus plan”

    Read it on shopify.dev

  • csideJul 15, 2026Contradicts

    cside, a seller of script monitoring, says Shopify's PCI certification covers Shopify, not your storefront, so app scripts, Pixels and tags on checkout stay your duty. It disputes Shopify's own position.

    “If your checkout has any app script, Pixel, chat widget, or analytics tag, you cannot cleanly attest SAQ A.”

    Read it on cside.com

  • PCI Security Standards CouncilMar 10, 2025Supports

    The PCI Security Standards Council says PCI DSS v4.x Requirements 6.4.3 and 11.6.1 require payment page scripts to be authorized, checked for integrity and monitored for tampering. It does not enforce compliance itself.

    “Scripts running in consumers' browsers are now a significant target for attackers seeking to steal payment card data.”

    Read it on blog.pcisecuritystandards.org

  • The PCI Council says merchants using an embedded payment form or iframe must confirm their site resists script attacks to use SAQ A, through their own checks or their payment processor. Full redirects are exempt.

    “The merchant has confirmed that their site is not susceptible to attacks from scripts that could affect the merchant's e-commerce system(s).”

    Read it on pcisecuritystandards.org

  • The PCI Security Standards Council says a merchant using a payment iframe qualifies for SAQ A only if every element that captures card data sits inside the iframe, not on the merchant's own page.

    “If any element involved in the collection or processing of payment card data is present on or provided by the merchant website, the merchant is not eligible for SAQ A.”

    Read it on pcisecuritystandards.org

In the full answer

For readers who sign in
  • What to do this week3 steps
  • The numbers behind it2 figures from cited sources
  • The strongest disagreementThe best case against the answer, from a cited source
  • How sure we areWhat its confidence rests on, and what would change the answer

Read next

More in Checkout and payments