When a skimming script is found on a checkout page, every card typed into that page since the script first appeared is presumed stolen, and the response is judged on how precisely you can date that window. Web skimming, often called Magecart after the groups first associated with it, injects JavaScript into payment or login pages so that card numbers and credentials are copied to an attacker as the shopper types (ATT&CK T1059.007 JavaScript and T1185 Browser Session Hijacking describe the browser side). Because the code runs in the shopper's browser, server logs and WAFs often show nothing. This playbook template gives [Organisation] a response for skimmers on merchant-hosted pages, third-party scripts, tag managers and CDNs: confirm, preserve, remove, scope the exposure window, and work through the acquirer, card brand and data protection processes. Prevention is covered in the Client-Side Security Guide and the PCI DSS for E-commerce Payment Page Scripts Guide.
How to use this template
- Adopt it as a sub-playbook of [Organisation]'s incident response plan and of the PCI DSS incident response plan required by Requirement 12.10.1. See the Incident Response Plan Template.
- Attach the payment page script inventory kept for PCI DSS Requirement 6.4.3 and the change and tamper detection alerts from Requirement 11.6.1. Those two records are your baseline for spotting what changed and when.
- Put your acquirer's compromise procedure next to this page. Notification routes and deadlines for card brands come from your acquirer and merchant agreement, not from this template.
- Replace every [placeholder] and walk through the playbook in a tabletop with the e-commerce, payments and legal teams.
1. Scope and triggers
1.1 This playbook applies to any unauthorised script, script modification, iframe or HTTP header change on an [Organisation] web page that collects payment card data, credentials or other personal data, whether the code was introduced on [Organisation]'s servers, in a third-party script, a tag manager container, a CDN, a page cache or a hosted payment component.
1.2 Common injection points:
| Injection point | How it typically happens | First evidence source |
|---|---|---|
| Merchant's own code or e-commerce platform | Exploited web application or plugin (T1190), stolen admin login | Deployment history, file integrity monitoring, admin audit log |
| Static assets on cloud storage or CDN | Leaked cloud key with write access to the bucket behind the CDN | Cloud audit log of object writes |
| Third-party script provider | Provider's own infrastructure compromised (supply chain) | Provider notification, script hash change |
| Tag manager container | Compromised marketing account publishes a new tag | Tag manager version history and user log |
| Server-side page cache or build pipeline | Poisoned cache or CI change re-injects the script after each deploy | Cache and CI logs, comparison with source |
1.3 Triggers: an 11.6.1 change or tamper detection alert; a CSP violation report naming an unknown domain; a customer, bank or card brand reporting fraud traced to [Organisation] as a common point of purchase; a security researcher's report; an unexpected new script or domain in the inventory scan.
2. Roles and contacts
| Role | Named lead | Responsibilities |
|---|---|---|
| Incident lead | [Name, phone] | Declares the incident, owns the decision log and exposure window |
| Web or e-commerce engineering lead | [Name] | Captures served page states, removes scripts, deploys clean code |
| Payments lead | [Name] | Contacts the acquirer and payment service provider; supplies transaction data for scoping |
| PCI Forensic Investigator (PFI) | [Firm, if engaged] | Forensic investigation of the cardholder data compromise when required |
| Cloud and identity administrators | [Names] | Revoke the credential used to inject the script; review write access |
| Privacy and legal | [Names] | Data protection notifications, privilege, contracts with script providers |
| Communications and customer service | [Names] | Customer notices and call scripts |
2.1 PCI SSC describes PCI Forensic Investigators as qualified investigators who help establish whether a cardholder data compromise occurred, and when and how; they work for a Qualified Security Assessor company with a forensic practice. Check the Council's list for current status before engaging one.
3. Detection and triage
3.1 Capture what the browser receives, before changing anything. Save the full rendered page, every script and its hash, and the response headers, from several clean browsers, locations and user agents. Skimmers are often loaded only on the payment step, only for some visitors, or from obfuscated code, so a single fetch from a corporate network can miss them.
3.2 Confirm the behaviour. In an isolated test browser, use test card data only and record where form data is sent. Never enter real card numbers.
3.3 Find the source of the code: which file, container or cache entry serves it, and which account or credential wrote it. Pull deployment logs, file integrity alerts, CDN and cloud storage write logs, tag manager history and e-commerce admin logs.
3.4 Date the exposure window. The start is the earliest evidence of the malicious code being served: object write time, deployment or tag version, archived page captures, or the first 11.6.1 alert. The end is the confirmed removal time. Where evidence is weak, the start is the last date you can prove the page was clean.
3.5 Scope the data: from payment and order systems, list the transactions and accounts entered on the affected pages during the window. Include failed or abandoned checkouts, because the card was typed even if no order completed, and any login or account page that loaded the same script.
3.6 Decision (incident lead and payments lead): confirmed compromise of cardholder data, or not. If confirmed or likely, notify the acquirer under section 7 without waiting for full scoping.
4. Containment
4.1 Remove or neutralise the malicious code at its source, not only in the rendered page: revert the file, delete the tag version, purge the CDN and page cache, and block the exfiltration domain in an enforcing Content-Security-Policy.
4.2 Revoke the credential used to write the code: cloud access keys, CI tokens, e-commerce admin accounts, tag manager users. The AI agent retail card theft campaign served skimmers from a retailer's own CDN using an AWS access key with write access to the bucket behind it, and used a cron job that re-injected the skimmer after redeploys.
4.3 Hunt for re-injection: scheduled jobs, CI steps, container init steps and cache entries that put the code back.
4.4 Decision (incident lead and e-commerce owner): take checkout offline or keep trading. If the source of the injection is not yet closed, switch to a fully hosted payment page or take checkout offline; continued trading on a page that can be re-infected extends the exposure window.
5. Eradication
5.1 Close the entry route: patch the platform or plugin, remove write access to static asset buckets from anything that does not need it, enforce MFA on tag manager and e-commerce admin accounts.
5.2 Review every script on payment pages against the 6.4.3 inventory and remove anything that is not authorised and justified.
5.3 Rotate other secrets that the attacker's foothold could reach, such as payment gateway API keys and admin credentials. See the PCI DSS Requirements for Service Accounts and NHIs Guide (8.6).
6. Recovery
6.1 Restore checkout only when the page served to browsers matches the approved script inventory and headers, verified from outside the network.
6.2 Deploy integrity controls: Subresource Integrity for static, versioned scripts, a strict Content-Security-Policy, and Content-Security-Policy-Report-Only for monitoring changes before enforcing them. MDN notes the Report-Only header cannot be delivered in a meta element, so send it as an HTTP header.
6.3 Increase 11.6.1 monitoring frequency on payment pages for [90] days and review every alert.
7. Communication and notification
| Audience | Owner | When |
|---|---|---|
| Acquirer and payment service provider | Payments lead | As soon as compromise is suspected, per the merchant agreement; they guide card brand notification and any PFI requirement |
| Data protection regulator | Privacy lead | Where a risk to individuals is likely; for the UK ICO, as soon as possible and where feasible within 72 hours |
| Affected customers | Privacy lead and communications | Without undue delay where the risk is high, using the transaction list from 3.5 |
| Third-party script provider | Engineering lead | Immediately if their script was the vector; other customers may be affected |
| Law enforcement | Incident lead | At confirmation, and through the PFI where one is engaged |
7.1 PCI SSC states that it does not enforce compliance and that entities should confirm validation and reporting duties with their acquirers or payment brands. Record every contact and instruction in the decision log.
8. Post-incident review
8.1 Record the timeline: injection, first evidence of skimming, detection, removal, acquirer notice, customer notice.
8.2 Root cause questions: Who or what could write to the files the browser loads? Did 11.6.1 monitoring see the change, and how quickly? Was the script on the 6.4.3 inventory? Were tag manager and CDN credentials treated as privileged?
8.3 Metrics: time from injection to detection (the exposure window); time from detection to removal; percentage of payment page scripts with an integrity control; number of identities with write access to payment page assets; 11.6.1 alert review time.
Implementation guidance
- Decide your integration type. A fully hosted or redirect payment page removes most of the card data from your page; an embedded iframe or merchant-hosted form keeps the parent page in scope. PCI SSC's March 2025 supplement "Payment Page Security and Preventing E-Skimming" explains how scope follows the integration.
- Treat asset write access as a privileged identity. Cloud keys, CI tokens and tag manager accounts that can change payment page code deserve the same controls as production admins.
- Keep evidence ready. Retain dated copies of the payment page and script hashes from 11.6.1 monitoring so the exposure window can be dated from your own records.
- Avoid the common mistakes. Teams delete the malicious file before capturing it, which destroys the evidence that dates the window; fix the rendered page but leave the writing credential live, so the skimmer returns; check only from the office network and miss conditional loading; or scope only completed orders and under-notify customers whose cards were typed into abandoned checkouts.
- Brief customer service early. Shoppers contact the merchant when their bank reissues cards. Give agents a holding statement and an escalation route on the day the acquirer is notified.
- Size by organisation. A small merchant on a hosted payment page mainly needs its platform's admin MFA and a clear acquirer contact. A large merchant with a custom checkout needs script inventory automation, browser-side monitoring and a retained PFI.
| Playbook section | PCI DSS v4.0.1 | NIST CSF 2.0 | NIST SP 800-53 Rev. 5 |
|---|---|---|---|
| Script inventory and integrity | 6.4.3 | ID.AM-02 | SI-7, CM-7 |
| Change and tamper detection | 11.6.1 | DE.CM-09 | SI-4, SI-7 |
| Incident response plan | 12.10.1 | RS.MA-01 | IR-8, IR-4 |
| Evidence and scoping | 12.10.1 | RS.AN-03, RS.AN-06 | IR-4 |
| Notification | 12.10.1 | RS.CO-02 | IR-6 |
References: PCI SSC: Payment Page Security and Preventing E-Skimming information supplement · PCI SSC: PCI Forensic Investigators · NIST: SP 800-61 Rev. 3 Incident Response Recommendations · ICO: Personal data breach reporting · MDN: Content-Security-Policy-Report-Only · MITRE ATT&CK: T1059.007 JavaScript
This template is provided for guidance and must be adapted to your organisation. Related NHI Mgmt Group resources: Client-Side Security Guide · PCI DSS for E-commerce Payment Page Scripts Guide · PCI DSS 4.0 Guide · Cybersecurity for Retail and Ecommerce Guide