Skip to content

E-Commerce & Retail Penetration Testing

Penetration testing for e-commerce and retail: PCI DSS obligations, the checkout and payment risks that matter, Magecart and API threats, and how to scope a test.

Invadel TeamAugust 27, 20264 min read

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-organised population.

It runs on a stack of third parties. Payment gateways, analytics, chat widgets, tag managers, marketing pixels, review platforms , a typical checkout page loads scripts from many external domains. 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, and it requires penetration testing , annually and after significant change, covering both the network and application layers, including 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. Our PCI DSS penetration testing page details what the assessment must cover, 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 is invisible to both of you for months.

Because it rides in through a trusted external script, this attack defeats defences 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.

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 defences 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 are a leading source of e-commerce vulnerabilities.
  • Infrastructure and cloud , the hosting, CDN, and cloud configuration behind the store.

See web application penetration testing for how the storefront itself is tested.

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 defence against credential stuffing.
  • Broken access control in APIs , exposing orders, customer data, or account functions.

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, and the defining threat , Magecart client-side skimming , rides in through trusted external scripts, so it has to be tested for specifically. In online retail, the payment page is the crown jewel; test it like one.

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 centre it on your payment flow.

Written by

Invadel Team

Senior penetration testers writing from real engagements — the same team that scopes, tests, and reports for our clients. About Invadel →

Find out what an attacker sees.

Tell us what to test and see your fixed price.

Prefer the full scoping questionnaire?
Start the conversation