PCI DSS for E-Commerce: The Complete Compliance Guide for Online Merchants | Lorikeet Security Skip to main content
Back to Blog

PCI DSS for E-Commerce: The Complete Compliance Guide for Online Merchants

Lorikeet Security Team February 28, 2026 11 min read

E-commerce introduces PCI DSS challenges that brick-and-mortar merchants do not face. Your payment page is accessible to anyone on the internet. Third-party JavaScript runs on pages where customers enter card data. Payment integrations range from simple redirects to complex client-side tokenization flows, and each model carries different compliance obligations.

PCI DSS v4.0 added requirements specifically targeting e-commerce threats, most notably Requirement 6.4.3 for payment page script management. If you run an online store, these changes directly affect your compliance posture and your SAQ type.


Payment Page Architecture and SAQ Impact

Integration Type How It Works SAQ Type
Full redirect Customer leaves your site entirely, enters card data on processor's domain (e.g., Stripe Checkout, PayPal Standard) SAQ A (22 requirements)
Iframe embed Payment form rendered in an iframe from the processor, embedded on your page. Your page serves JavaScript but card data goes directly to processor SAQ A-EP (191 requirements)
JavaScript SDK Payment fields rendered by processor's JavaScript SDK on your page (e.g., Stripe Elements, Braintree Hosted Fields). Card data tokenized client-side SAQ A-EP (191 requirements)
Direct post Card data entered on your form, posted directly to processor API from the browser. Your server never sees the PAN SAQ A-EP (191 requirements)
Server-side processing Card data submitted to your server, then forwarded to processor via server-side API call. Your server handles the PAN SAQ D (326 requirements)

JavaScript Skimming and Magecart

Magecart attacks are the defining e-commerce security threat. Attackers inject malicious JavaScript into payment pages that captures card data as customers type it, then exfiltrates the data to attacker-controlled servers. The attack happens entirely in the customer's browser, bypassing server-side security controls.

Attack vectors include compromised third-party scripts (analytics, chat widgets, A/B testing tools), supply chain attacks on JavaScript CDNs, compromised CMS plugins, cross-site scripting vulnerabilities, and compromised developer accounts. A single compromised script on your payment page can capture every card number entered.

Why this matters for SAQ A merchants: Even if you use a full redirect checkout and qualify for SAQ A, a Magecart-style attack on your product pages could redirect customers to a fake payment page before they reach the legitimate checkout. The threat extends beyond just the payment page itself.


Requirement 6.4.3: Payment Page Script Management

PCI DSS v4.0 added Requirement 6.4.3 specifically to combat JavaScript skimming. This requirement mandates that all payment page scripts are managed with the following controls:

Implementation approaches

Content Security Policy (CSP) is the most common approach. A properly configured CSP header restricts which domains can serve JavaScript on your payment pages. Any script from an unauthorized domain is blocked by the browser. CSP with script-src directives is the foundation, but it requires ongoing maintenance as legitimate scripts are added or CDN domains change.

Subresource Integrity (SRI) adds hash verification to external scripts. The browser verifies that the script content matches the expected hash before executing it. If an attacker modifies the script on the CDN, the hash will not match and the browser will refuse to execute it. SRI works well for stable scripts but requires hash updates whenever the script vendor publishes an update.


Tokenization for E-Commerce

Tokenization is the most effective scope reduction strategy for e-commerce. Instead of storing PANs, store tokens issued by your payment processor. Tokens can be used for recurring billing, refunds, and customer account management without your systems ever handling the actual card number.

Most modern payment processors provide tokenization as part of their standard integration. Stripe, Braintree, Adyen, and others return tokens when a payment method is created. Store the token, not the card number. Use the token for subsequent charges. Your systems never need to see the PAN after the initial tokenization, which happens in the customer's browser via the JavaScript SDK.


Common E-Commerce PCI Failures

Need e-commerce security testing?

We test e-commerce platforms for PCI DSS compliance, including payment page security, JavaScript skimming vulnerabilities, and Requirement 6.4.3 validation.

-- views
Link copied!
Lorikeet Security

Lorikeet Security Team

Penetration Testing & Cybersecurity Consulting

We've completed 170+ security engagements across web apps, APIs, cloud infrastructure, and AI-generated codebases. Everything we publish here comes from patterns we see in real client work.

Lory waving

Hi, I'm Lory! Need help finding the right service? Click to chat!