Preventing e-skimming means controlling every script that runs on your checkout page, through subresource integrity checks, a tightly scoped content security policy, sandboxed third-party code, and active monitoring for unauthorized changes. No single control stops every variant, which is why layering matters more than picking one tool. The businesses that get hit hardest are usually the ones that assumed their payment gateway alone had this covered.
E-skimming doesn’t need your server, your database, or even a vulnerability in your checkout flow. It needs one script, often a third-party one you didn’t write and may not even remember adding, quietly reading what a customer types before it ever reaches your payment processor. That’s what makes it such an uncomfortable category of attack for web application development teams: the server-side code can be flawless and the breach still happens entirely in the customer’s browser.
E-skimming is the practice of injecting malicious JavaScript into a webpage, usually a checkout or payment page, to capture payment card data directly from the browser as a customer types it. It’s also called digital skimming, web skimming, or formjacking, and the broader family of attacks that use this technique is widely referred to as Magecart, named after the group that popularized it against Magento storefronts.
Unlike a traditional data breach that targets a server or database, e-skimming happens entirely on the client side. The card number never has to touch your infrastructure for an attacker to steal it, which is exactly why server hardening alone doesn’t solve this problem.
The term itself isn’t new. The FBI and CISA issued a joint alert on e-skimming back in 2019, warning businesses that attackers were actively targeting checkout pages this way. What’s changed since then isn’t the basic technique, it’s how deeply e-skimming prevention is now built into PCI DSS compliance itself, which this post gets into further down.
Most e-skimming incidents start with a compromised third-party script rather than a direct attack on the merchant’s own code. A tag manager, an analytics snippet, a chat widget, or a marketing pixel gets compromised at its source, and the malicious update then ships automatically to every site loading that script, including yours, without anyone on your team changing a line of code.
Once that script is running on your payment page, it typically does one of two things. It either reads form field values as the customer types and quietly sends them to an attacker-controlled server, or it injects a fake payment form that overlays the real one and captures everything before passing the customer along as if nothing happened. Both techniques can run for months undetected, since the checkout still works normally from the customer’s point of view.
| Technique | What It Stops | Where It Falls Short |
|---|---|---|
| Subresource Integrity (SRI) | Scripts tampered with after you first approved them | Doesn’t help if a vendor’s live endpoint changes legitimately and breaks your pinned hash |
| Content Security Policy (CSP) | Unapproved domains loading scripts at all | Governs which domains can load, not what an approved but compromised script does once it’s running |
| Script inventory and authorization | Unknown or unapproved scripts appearing on the payment page | Only works if the inventory is actually maintained as scripts change |
| Change and tamper detection | Unauthorized changes to page content or HTTP headers | Detects after the fact, not in real time, unless monitoring runs frequently |
| Sandboxed iframes for third-party code | A compromised vendor script reading your page’s DOM or cookies | Breaks integrations that need deep access to the host page |
| Reducing third-party scripts | The overall attack surface across your checkout flow | Requires ongoing vendor discipline, not a one-time cleanup |
Subresource Integrity, or SRI, lets you pin a cryptographic hash to every third-party script you load, so the browser refuses to execute it if the file has changed since you approved it. This is one of the more effective controls available, but it has a real maintenance cost. A vendor pushing a legitimate update to their script will break your pinned hash just as surely as an attacker tampering with it, so someone on your team needs to own re-verifying and re-pinning those hashes when vendors update.
A content security policy restricts which domains a browser is allowed to load scripts, fonts, and other resources from on a given page. It’s a genuinely useful layer, but don’t treat it as a complete answer.
OWASP’s own guidance on managing third-party JavaScript recommends CSP as an addition to other controls, not a replacement for them, because CSP only governs which domains can load code, not what an already-approved script does once it’s running. If an attacker compromises a vendor you’ve already whitelisted, CSP won’t stop the resulting skimming.
Loading vendor code inside a cross-origin iframe, with the sandbox attribute set and communication limited to postMessage, keeps that script from reading your page’s DOM, cookies, or form data even if it’s compromised. This is one of the strongest structural defenses available, though it requires vendors whose integrations can actually tolerate that isolation, which not every analytics or marketing tool supports out of the box.
PCI DSS 4.0.1 formalized two of these practices as explicit requirements for merchants whose payment pages aren’t fully outsourced: authorizing and maintaining a written inventory of every script running on the payment page, and running a mechanism that detects unauthorized changes to that page’s content or headers, ideally far more often than the standard’s minimum weekly check. These two requirements exist specifically because of e-skimming, and they map directly to the technical controls described above rather than sitting apart from them.
E-skimming prevention isn’t just a security best practice anymore. It’s now woven directly into PCI DSS eligibility itself. If your checkout embeds a payment provider’s form through an iframe, PCI SSC’s FAQ 1588 requires you to confirm your site is protected against script-based attacks before you can even claim the simpler self-assessment questionnaire, rather than relying on your provider’s compliance alone.
We covered exactly which questionnaire applies based on how your payment page is built, redirect, iframe, or direct post, in our guide to SAQ A vs SAQ A-EP, which is worth reading alongside this post if you’re not sure which eligibility rules currently apply to your checkout.
Reducing how much of your own code touches the payment page in the first place is itself a form of e-skimming prevention. A fully outsourced redirect or iframe checkout, built and maintained through solid API and backend development practices, gives attackers far less surface to compromise than a custom-built payment form your own JavaScript constructs directly.
For the full picture of what PCI DSS expects beyond script management specifically, tokenization, access controls, and the rest of the standard, see our complete guide to PCI DSS for payment apps.
The same scrutiny you’d apply to a web checkout also belongs in fintech app development more broadly, since any product moving payment data, not just a storefront, carries the same client-side exposure.
Most successful e-skimming attacks don’t exploit some exotic vulnerability. They exploit the gap between what a security team assumes is running on a page and what’s actually running on it.
Trusting a vendor’s compliance as a substitute for your own monitoring. A PCI DSS compliant payment gateway doesn’t make every other script on your checkout page safe by association.
Treating tag managers as a marketing tool rather than a code deployment pipeline. Anyone with publishing access to a tag manager container can push new JavaScript to your payment page instantly, often without a code review.
Setting a content security policy once and never revisiting it. A policy that was airtight at launch tends to accumulate exceptions over time as new tools get added, until it’s permissive enough to stop protecting much of anything.
Assuming server-side security covers client-side risk. A hardened backend and a locked-down database do nothing to stop a script running in the customer’s own browser. Our web app security checklist covers the broader set of practices that need to work alongside the script-specific controls in this post, not instead of them.
Detection matters as much as prevention, since even well-defended sites can be compromised through a trusted vendor’s own breach. Look for unexplained changes to your payment page’s file sizes, hashes, or HTTP response headers, which a properly configured change-detection tool should flag automatically rather than requiring someone to notice manually.
Unusual outbound network requests from the checkout page are another strong signal, since exfiltrated card data has to go somewhere, and that destination is rarely one of the domains your team actually approved. Pair automated monitoring with periodic manual review of exactly which scripts load on your live payment page, since a script that was safe when first approved can be compromised at its source without your code changing at all.
E-skimming keeps succeeding because it targets the part of a checkout flow most security reviews skip, the actual JavaScript running in the customer’s browser. Getting the architecture right from the start, fewer third-party scripts, sandboxed vendor code, and real monitoring, is far cheaper than responding to a compromise after the fact. If you’re building or hardening a checkout experience and want it designed around this threat from day one, talk to our team before your next payment page integration ships.
A traditional data breach usually involves an attacker accessing a server or database directly. E-skimming happens in the customer’s browser through a compromised script, which means the card data can be stolen without ever reaching your servers.
Yes. Your gateway’s compliance covers its own infrastructure, not the other third-party scripts, analytics tools, or marketing pixels running elsewhere on your checkout page.
No. CSP restricts which domains can load scripts, but it doesn’t control what an already-trusted, compromised script does once it’s running, which is why it needs to be paired with Subresource Integrity, sandboxing, and change detection.
PCI DSS sets a minimum of roughly every seven days for merchants it applies to, but given how quickly a compromised script can exfiltrate data, more frequent automated monitoring is worth the investment for any high-traffic checkout.
No. Smaller merchants are frequently targeted precisely because they’re less likely to have dedicated security monitoring in place, and the same compromised third-party script can hit thousands of smaller sites at once.
Audit exactly which scripts currently load on your payment page and remove anything that isn’t essential. Fewer third-party scripts means fewer things that can be compromised, and it’s the one control that doesn’t require new tooling to start.
Bilal Parker is a content writer and researcher with a passion for exploring new ideas, industry trends, and topics that shape modern life. He specializes in creating engaging, well-researched articles covering business, lifestyle, productivity, and digital trends. Through clear storytelling and practical insights, Bilal aims to simplify complex subjects, share valuable knowledge, and help readers stay informed, inspired, and ahead of the curve.
Submit your details and our team will reach out to discuss how we can bring your app or software idea to life.
Your request has been successfully submitted. Our team will be in touch with you shortly.
This window will close automatically.