E-commerce penetration testing is a manual security test of an online store’s checkout, payment integration, accounts, APIs and third-party scripts. If you accept cards, PCI DSS Requirement 11.4 usually requires one every year and after significant change, depending on your SAQ type. This guide covers the rules, scope and cost; our e-commerce penetration testing services page covers the service itself.
An e-commerce site is a payment system with a storefront attached, and attackers treat it accordingly. Every checkout handles card data, every account holds a saved payment method, and every third-party script on the page is a potential thief. E-commerce and retail penetration testing focuses on exactly where the money and the card data move, because that is precisely where attackers concentrate.
Why online retail is a standing target
Three properties make e-commerce uniquely exposed:
It processes payments directly. Card data flows through checkout on every order. That puts you in scope for PCI DSS and makes you a target for anyone who wants card numbers, which is a large and well-organized population.
It runs on a stack of third parties. A typical checkout page loads scripts from many external domains: payment gateways, analytics, chat widgets, tag managers, marketing pixels and review platforms. Each one executes in the same page as the payment form, and each is a potential entry point. This is the mechanism behind Magecart.
Traffic and seasonality invite abuse. High volume hides malicious activity, and peak periods, the sale, the launch, the holiday, are exactly when attackers strike and when you can least afford downtime.
PCI DSS is the baseline
If you accept card payments, PCI DSS applies (the current version is PCI DSS v4.0.1), and for merchants validating with a Report on Compliance, SAQ D or SAQ A-EP it requires penetration testing, annually and after significant change, covering both the network and application layers, including network segmentation testing of any segmentation you rely on to reduce scope. How your integration works changes your obligations: a fully hosted/redirect checkout reduces (but does not eliminate) scope, while any setup where card data touches your own pages pulls the full requirement onto you. Your PCI compliance level and SAQ type decide what you submit each year. Our PCI DSS penetration testing page details what the assessment must cover, our guide to PCI DSS penetration testing requirements breaks down each part of Requirement 11.4, and the PCI compliance checklist walks the broader requirements.
Note the trap: even a “hosted” checkout does not make you safe. If an attacker can modify your pages, they can swap or wrap the hosted payment form, which is exactly what the next section is about.
Magecart and client-side skimming, the defining e-commerce threat
The signature attack against online retail is client-side skimming (Magecart): the attacker injects malicious JavaScript into your checkout, directly or, more often, through a compromised third-party script, that quietly copies card details as the customer types and sends them to the attacker. The customer completes their purchase normally; nothing looks wrong; the theft can stay invisible to both of you for weeks or months. A 2019 joint bulletin on online skimming from the PCI Security Standards Council and the Retail and Hospitality ISAC warned that these attacks are very difficult to detect without the proper controls.
Because it rides in through a trusted external script, this attack defeats defenses aimed only at your own code. Testing has to examine the third-party scripts on your payment pages, your controls over what those scripts can do (Content Security Policy, Subresource Integrity), and your ability to detect unexpected script changes. This is a scope item generic web tests routinely miss.
PCI DSS 6.4.3 and 11.6.1: the payment page script rules
Two requirements aimed squarely at Magecart became mandatory on March 31, 2025, after starting as best practices in PCI DSS v4.0:
- Requirement 6.4.3 covers every script loaded and executed in the customer’s browser on the payment page, including scripts from third and fourth parties. You need a method to confirm each script is authorized, a method to assure its integrity, and an inventory of all scripts with a written justification for why each one is necessary.
- Requirement 11.6.1 requires a change- and tamper-detection mechanism that alerts your staff to unauthorized changes to the payment page’s security-impacting HTTP headers and script contents, as the customer’s browser receives them. It must run at least weekly, or at the frequency your targeted risk analysis sets.
In January 2025 the PCI Security Standards Council removed both requirements from SAQ A, the questionnaire for merchants that fully outsource the payment page, and replaced them with an eligibility check: the merchant confirms its own site is not susceptible to script attacks that could affect its e-commerce systems. The revised SAQ A took effect on March 31, 2025. The underlying requirements did not go away, and SAQ A-EP, SAQ D, and Report on Compliance merchants still carry both.
A checkout penetration test checks the controls rather than the paperwork. Does the script inventory match what the page actually loads? Do Content Security Policy and Subresource Integrity block a script that is not on the list? Does an injected change to the payment page trigger the 11.6.1 alert? The report gives your QSA evidence for both requirements alongside the Requirement 11.4 test.
What to scope
- The checkout and payment flow end to end, the single highest priority. Card handling, payment-gateway integration, and every script running on those pages.
- Business logic, the e-commerce-specific abuse cases: manipulating prices or quantities, abusing discount and coupon logic, bypassing payment steps, exploiting refund and store-credit flows, gift-card fraud. Scanners never find these.
- Accounts and authentication, saved payment methods, addresses, and order history make account takeover lucrative. Test login, registration, password reset, and defenses against credential stuffing.
- APIs, modern and headless commerce is API-driven; the mobile app and storefront both lean on them. See API penetration testing.
- The platform and its plugins, Magento, WooCommerce, Shopify apps and their extensions. Third-party plugins and extensions are a common source of e-commerce vulnerabilities, and the runtime underneath matters too: stores on PHP platforms such as Magento and WooCommerce should check our PHP2Shell patch guide.
- Automated abuse, the bot cases in the OWASP Automated Threats list, such as carding (OAT-001), bulk testing of stolen cards against your checkout, and denial of inventory (OAT-021), holding stock in carts without buying.
- Infrastructure and cloud, the hosting, CDN, and cloud configuration behind the store.
See web application penetration testing for how the storefront itself is tested. If you also take cards in person, at a hotel front desk or a restaurant table, our page on hotel and restaurant PCI testing covers the on-premises side.
Payment gateway and checkout integration testing
Payment gateway penetration testing covers your integration with the gateway, not the gateway’s own systems, which belong to the provider. The checks follow the integration type:
- Redirect. Can the amount, currency or order reference be changed before the handoff, or the return URL forged so an unpaid order is marked paid?
- Iframe or hosted fields. Can your page be altered to replace or overlay the gateway’s card form?
- Direct API. Your server handles card data or tokens, which carries the widest PCI scope.
- All three. Webhook signature validation (can a forged or replayed payment notification release goods), tokenisation, 3-D Secure steps that can be skipped, refund logic, and secret API keys in client-side code.
Penetration testing a Shopify or BigCommerce store
On Shopify, BigCommerce and other hosted platforms, the platform runs the servers and the checkout. Shopify, for example, states that it is certified Level 1 PCI DSS compliant and that this extends by default to stores on its platform (Shopify). You cannot authorize a test of infrastructure you do not own, so a hosted store is scoped to what you control: theme code and custom JavaScript, installed and custom apps with their API tokens, headless storefronts and middleware you host, integrations and their webhooks, admin accounts, and every third-party script you add. Those scripts still run in your customers’ browsers, so the skimming risk remains yours. Confirm the platform’s testing rules in writing before work starts.
What these tests typically find
- Business-logic flaws, price and quantity manipulation, coupon and refund abuse, payment-step bypasses.
- Vulnerable third-party scripts and plugins, the Magecart entry point, and outdated extensions with known flaws.
- Weak client-side controls, missing Content Security Policy and Subresource Integrity on payment pages, leaving skimming undetectable.
- Account-takeover exposure, weak authentication and no defense against credential stuffing.
- Broken access control in APIs, exposing orders, customer data, or account functions.
What an e-commerce penetration test costs
Our prices are published and fixed in writing before work starts. Web application testing, which covers the storefront and checkout, starts at $5,200; the web application penetration testing cost page shows what moves a store between tiers. API testing starts at $4,000. A full PCI DSS scope adds external network testing from $4,200 and internal network testing from $6,000. Every penetration test includes a free retest of the findings you fix. The full list is on our penetration testing pricing page.
Our guide to PCI penetration testing cost covers how the combined scope is priced. Quarterly ASV scans and Report on Compliance assessments are delivered through our PCI partner, Sovereign Secure.
Frequently asked questions
Do I need penetration testing for my e-commerce site? If you accept cards and validate with a Report on Compliance or SAQ D, yes: Requirement 11.4 calls for internal and external testing at least once a year and after significant change. SAQ A-EP, for sites that affect the payment page without receiving card data, calls for the external test, plus segmentation testing if segmentation reduces your scope. If you fully outsource the payment page under SAQ A, the standard does not require it, but acquirers, marketplaces, and business customers may still ask, and account takeover and discount abuse cost money whether or not PCI applies. Quarterly ASV scans are a separate requirement and do not replace the test: see ASV scan vs penetration test.
How often should an online store be tested? At least once a year, and again after a significant change such as a replatforming, a new payment provider, a checkout redesign, or a new mobile app that shares the storefront’s API.
Will testing disrupt sales? It should not. We test against staging wherever one exists. When production is the only option, we agree written rules first: no denial-of-service techniques, no real orders beyond agreed test transactions, and windows outside your peak hours.
How long does an e-commerce penetration test take? Testing typically starts within a week of signing and runs one to three weeks, with the report two days after testing ends.
The short version
E-commerce penetration testing concentrates where retail actually bleeds: the checkout, the payment flow, the third-party scripts on your payment pages, and the business logic around prices, discounts, and refunds. PCI DSS makes testing a baseline requirement unless you fully outsource the payment page under SAQ A, and the defining threat, Magecart client-side skimming, rides in through trusted external scripts, so it has to be tested for specifically, now backed by Requirements 6.4.3 and 11.6.1. In online retail, the payment page is the crown jewel; test it like one.
Evaluating a test rather than reading up? The e-commerce penetration testing services page covers what we test in this sector, which frameworks apply, and the fixed starting prices.
Running an online store and need testing that satisfies PCI DSS and actually checks your checkout for skimming and logic abuse? Scope an e-commerce assessment and we will center it on your payment flow.
Written by
Wahid Iqbal, Head of Compliance
20+ years in the field. Focus: PCI DSS, ISO 27001 & ISO 22301. Part of the team that scopes, tests, and reports for our clients. Full profile →