How to Protect Against Magecart

News desk, CyberRank
News recaps on advisories, outages and incidents that change third-party risk, checked against the sources they cite.
Part of: Supply Chain Security
You protect against Magecart by keeping payment and login pages free of unnecessary scripts, authorising and locking the ones you keep, detecting any change to them, and checking the companies that supply them. CyberRank covers the supplier check: it rates each script vendor and its own suppliers from one web address in 10–60 minutes and re-scans monitored vendors daily.
Key Takeaways
- Magecart protection starts with fewer scripts on sensitive pages and control over the rest, and CyberRank rates the vendors who supply the scripts you keep.
- Detection means watching scripts as the browser receives them; PCI DSS 11.6.1 has required this on payment pages since 31 March 2025.
- A Magecart scanner can only see what a script does today; vendor ratings and monitoring tell you how likely it is to change tomorrow.
How to protect against Magecart: five controls
Magecart protection rests on five controls, and CyberRank covers the fifth, checking the vendors behind your scripts, across your whole supplier list.
The first four controls protect the page; the fifth protects you from the supplier. A script that passes every check today can still be replaced tomorrow if its owner is breached. The full picture of how these attacks work is in our guide to Magecart attacks.
| Control | What it does | Example |
|---|---|---|
| Reduce | What it doesRemoves scripts from payment and login pages that do not need to be there | ExampleNo chat, advertising or A/B testing on the checkout page |
| Authorise | What it doesKeeps a list of approved scripts and blocks the rest | ExampleA Content Security Policy that only allows named sources |
| Lock | What it doesMakes sure an approved script has not been changed | ExampleSubresource Integrity (SRI) hashes on fixed script versions |
| Detect | What it doesAlerts you when a script or security header changes | ExampleA change- and tamper-detection tool on payment pages |
| Check the supplier | What it doesJudges how likely the script's owner is to be compromised | ExampleA CyberRank rating and monitoring of each script vendor |
Magecart detection: what a scanner can and cannot see
Magecart detection watches what scripts do in the browser, and CyberRank adds what a scanner cannot: how secure the companies behind those scripts are.
Use both views together: page-level detection to catch a change quickly, and vendor ratings to decide which scripts you can afford to keep. Scripts that set tracking cookies raise a second question, consent, covered in how to check if a website sets cookies before consent.
- A Magecart scanner can see which scripts load, where they send data and whether they changed since the last check.
- It cannot see that a script supplier has leaked staff passwords, exposed admin portals or a recent breach, the signs that come before a script is swapped.
- PCI DSS 6.4.3 asks you to inventory, authorise and check the integrity of payment-page scripts; 11.6.1 asks you to detect unauthorised changes at least weekly or at a risk-based frequency. Both have been mandatory since 31 March 2025.
Example: what to ask a chatbot or analytics vendor
Before a chatbot or analytics vendor's script goes near a payment page, ask a few targeted questions, and let CyberRank's rating decide whether the answers need checking.
The UK regulator's 2020 fine against Ticketmaster followed malicious code entering through a third-party chatbot on its payment page; the ICO said the chatbot could have been left off that page.
- Ask whether the script really needs to run on the payment or login page.
- Ask how the script is built and deployed, and who can change it.
- Ask whether a fixed version can be used, so integrity checks work.
- Ask how quickly the vendor will tell you if its script delivery is compromised.
- Rate the vendor and its own suppliers with CyberRank, and monitor the ones that stay.
Why CyberRank for Magecart protection
CyberRank shows which script suppliers deserve your trust before their code runs next to your customers' card details.
CyberRank rates what an organisation exposes publicly, and AI-powered questionnaires add internal evidence where you need it.
Create a free account to see how your organisation rates.
- Ratings in 10–60 minutes for every script supplier, from its web address, with no agents or system access.
- Fourth parties: a supplier's own suppliers rated with the same pipeline.
- Daily re-scans, darknet monitoring and email alerts for monitored vendors.
- Pay per vendor: 20 credits ($20) per assessment, unlimited users; see pricing.
References
Primary sources for the outside facts on this page (accessed 25 November 2026), and the CyberRank brochure for CyberRank facts.
- PCI Security Standards Council: Payment page security and preventing e-skimming
- PCI Security Standards Council FAQ: How does an e-commerce merchant meet the SAQ A eligibility criteria for scripts?
- UK ICO: Penalty notice, Ticketmaster UK Limited (November 2020)
- CyberRank Product Brochure 2026 (figures as of Oct 2026)
Frequently asked questions
Create a free account to see how your organisation rates.
CyberRank rates any organisation from its web address in 10–60 minutes: one IISRI® rating across 12 risk lenses, with no questionnaires, agents or system access. Your first assessment is ready within the hour.