Skip to content
MAGEKWIKScanner
critical

Magecart skimmers on Magento: how card-stealers hide, and how to spot them

Magekwik Security 8 min read

MALWARE & SKIMMERS CRITICAL Magento / Adobe Commerce scan.magekwik.com

Web skimmers steal card data straight from the checkout page. On Magento they hide in fake analytics domains, GTM containers, and even invisible SVG elements. A field guide to the techniques and the passive signals that expose them.

What a Magecart skimmer is

"Magecart" is the umbrella name for groups that inject client-side card skimmers into checkout pages. The malicious JavaScript reads what the shopper types into the payment form and quietly sends it to an attacker-controlled server. The transaction still succeeds, so nothing looks wrong — which is exactly why skimmers can run for months.

Where the code gets in

A skimmer is a symptom; the entry point is usually one of these:

  • An unpatched RCE (TrojanOrder, CosmicSting, SessionReaper) used to write to the database or filesystem.
  • A compromised admin account or leaked integration token.
  • A trojanised third-party extension or a supply-chain compromise of a hosted script.

Once inside, attackers store the payload where it will render on checkout: a CMS block, layout XML, the Miscellaneous HTML field, or a modified JS bundle.

How modern skimmers hide

Lookalike infrastructure

Skimmers load from domains that impersonate analytics — gooqle-analytics.com, webstatlstics.com — so a quick glance at network requests looks legitimate.
  • Trusted-service abuse: hiding the payload inside a Google Tag Manager container or a fake Google Analytics snippet, so it loads from a domain you already trust (Akamai documented this).
  • Fake favicons & images: a file served as image/png that actually contains script.
  • Invisible SVG: in 2025 Sansec found skimmers hidden in an <svg> element whose onload handler decodes a Base64 payload — no external script tag at all.
The SVG-onload pattern (illustrative)
&lt;svg width="0" height="0" onload="eval(atob('…base64…'))"&gt;&lt;/svg&gt;

How to spot one

  • Diff your rendered checkout HTML/JS against a known-good deployment — legitimate Magento does not ship packed, eval/atob-based inline scripts.
  • Review every external script origin on cart and checkout; flag lookalike and newly-registered domains.
  • Watch for inline <svg onload>, long Base64 blobs, and form-field listeners near cc_number.

How to stop it

  1. Find and close the entry point (patch the RCE, rotate the leaked credential) — or the skimmer returns.
  2. Restore code from a known-good build; hunt persistence in CMS/layout tables and admin users.
  3. Enforce a Content-Security-Policy. Magento ships Magento_Csp; move the storefront from report-only to restrict mode so an injected inline script simply cannot execute.
Enforce CSP on the storefront (Magento_Csp)
bin/magento config:set system/csp/mode/storefront/report_only 0
bin/magento cache:flush config full_page

Why CSP is the durable fix

From 2.4.7, Adobe puts payment pages in CSP restrictive mode by default. A tuned, enforced policy means a card-stealer injected tomorrow still can't run or phone home. It is the single most effective control against client-side skimming.

References & sources

Primary sources — advisories, vendor research, and the CVE record. Verify against these, not us.

  1. Sansec — SVG onload Magecart skimmer
  2. Akamai — Magecart hiding behind Google Tag Manager
  3. Microsoft — the shift in web skimming
  4. Adobe Commerce — Content Security Policy documentation
MALWARE & SKIMMERS CRITICAL Magento / Adobe Commerce scan.magekwik.com
critical Malware & skimmers

Backdoored and Abandoned Extensions: Supply-Chain Compromise of the Magento Ecosystem

Commercial Magento extensions run with core-level privilege on every request, which makes their license-check files an ideal home for a dormant backdoor. We dissect the 2025 Tigren/Meetanshi/MGS compromise, the 2022 FishPig/Rekoobe breach, and the polyfill.io skimmer — plus the exact grep and CSP checks to find and shut them down.

5 min read

← All security posts