Magecart: how attackers steal your customers' card details from your store

In short: Magecart refers to attacker groups that inject malicious JavaScript into online stores to steal card numbers entered at checkout. They don't need to hack your payment provider — they hack your store and intercept the data before it's encrypted. The infection is often silent for weeks.

How a Magecart attack works

The principle is brutally simple:

  1. The attacker gains access to your server or files (outdated module, weak FTP account, compromised third-party plugin, modified theme).
  2. They inject a small JavaScript snippet into a page your customers visit — often the checkout page or your theme's main JavaScript file.
  3. The script silently intercepts entered data (card number, expiry date, CVV) and sends it to a server the attacker controls.
  4. The code is designed to break nothing: the store keeps working normally, payments go through, nobody notices.

Magecart groups (some operating for years) automate this attack at scale: they continuously scan the web for vulnerable stores, like the botnets we described in our study of 60 stores.

Why your PrestaShop store is a target

How to detect an infection

Skimmer signs are rarely visible to the naked eye, but a few targeted checks often suffice:

This is exactly what PrestaShield's malware scan looks for automatically: known infection patterns (eval+decode, obfuscation, dynamic execution), recent files in critical folders, and modified .htaccess files. A full scan takes minutes and runs from your back office, with an email alert if anything changes between scans.

The 5 prevention reflexes

  1. Update everything: PrestaShop, modules, theme, PHP. An up-to-date site closes most entry points (see our full checklist).
  2. Restrict access: one FTP account per person, unique passwords, two-factor authentication everywhere.
  3. Protect files against writes: theme files and critical directories read-only on the server.
  4. Monitor integrity: a tool that detects modified files (like PrestaShield's scan) turns a silent infection into an immediate alert.
  5. Scan regularly: a weekly scan detects the vast majority of skimmers before they do damage.

If you think your store is infected, don't clean up before identifying the root cause — our article "My store was hacked" details the exact order of operations, and you can contact us for an intervention.

Check your store now

Passive audit, no modification of your site. Score /100 in 30 seconds.

Sources: public analyses of Magecart groups (RiskIQ/Microsoft), PrestaShop incident reports, OWASP recommendations on JavaScript integrity (SRI).