Quick answerNov 25, 2026Last updated Nov 25, 20265 min read

How to Protect Against Magecart

Two security cameras mounted on a ribbed metal wall, watching in opposite directions.
CR
CyberRank Editorial Team

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.

Magecart mitigation: what each control does
ReduceWhat it doesRemoves scripts from payment and login pages that do not need to be thereExampleNo chat, advertising or A/B testing on the checkout page
AuthoriseWhat it doesKeeps a list of approved scripts and blocks the restExampleA Content Security Policy that only allows named sources
LockWhat it doesMakes sure an approved script has not been changedExampleSubresource Integrity (SRI) hashes on fixed script versions
DetectWhat it doesAlerts you when a script or security header changesExampleA change- and tamper-detection tool on payment pages
Check the supplierWhat it doesJudges how likely the script's owner is to be compromisedExampleA 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.

  1. Ask whether the script really needs to run on the payment or login page.
  2. Ask how the script is built and deployed, and who can change it.
  3. Ask whether a fixed version can be used, so integrity checks work.
  4. Ask how quickly the vendor will tell you if its script delivery is compromised.
  5. 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.

  1. PCI Security Standards Council: Payment page security and preventing e-skimming
  2. PCI Security Standards Council FAQ: How does an e-commerce merchant meet the SAQ A eligibility criteria for scripts?
  3. UK ICO: Penalty notice, Ticketmaster UK Limited (November 2020)
  4. CyberRank Product Brochure 2026 (figures as of Oct 2026)

Frequently asked questions

You protect your website against Magecart by removing unnecessary scripts from payment pages, authorising and locking the rest, detecting changes and checking the suppliers. CyberRank covers the supplier check by rating each script vendor in 10–60 minutes.

The best Magecart mitigation is fewer scripts on payment and login pages, because a script that is not there cannot be compromised. For the scripts you keep, CyberRank's vendor ratings and daily re-scans show which suppliers carry the most risk.

Magecart detection works by watching the scripts a browser receives on sensitive pages and alerting you when they change or send data somewhere new. CyberRank complements it by rating the companies that supply those scripts.

A Magecart scanner is not enough on its own, because it sees what a script does today but not how likely its owner is to be breached. CyberRank adds that view with security, privacy and breach-history findings for each script supplier.

A Content Security Policy limits which sources scripts can load from, but it does not stop an attack that changes a script on an allowed source. CyberRank helps you judge whether those allowed sources are trustworthy.

To prevent web skimming, PCI DSS requirement 6.4.3 asks merchants to inventory and authorise payment-page scripts and 11.6.1 asks them to detect unauthorised changes, both mandatory since 31 March 2025. CyberRank supports these obligations with vendor evidence; it does not by itself make an organisation compliant.

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.