A Magecart skimmer is a piece of JavaScript that copies card details from your checkout and sends them to an attacker. On Magento it usually hides in the database or in a theme file rather than in an obvious new script. It often loads only on the checkout page, only for some visitors, or only once per browser, which is why a quick look from outside so often finds nothing.
This post explains where skimmers hide on Magento 2, why external scanners miss them, and the exact checks you can run on your own server today.
curl https://shopwhizzy.com/gowiz/external/agent | sh
More about it on the WhizzyScan page.
How skimmers get in
Almost every infection starts with one of three things:
- An unpatched Magento vulnerability. Attackers scan for stores missing a security release within days of each Adobe bulletin.
- A vulnerable or compromised extension. Third-party modules run with the same permissions as Magento itself.
- Stolen admin or server credentials. Reused passwords, no two-factor authentication, or a leaked deploy key.
Once inside, attackers usually leave a backdoor first and add the skimmer later. That is why cleaning the skimmer alone rarely ends the problem.
Where skimmers hide on Magento 2
In the database
This is the favourite spot, because it survives code deployments and most file scanners never look there.
- Configuration values in
core_config_data, especially the fields that inject HTML into every page:design/head/includesanddesign/footer/absolute_footer. - CMS blocks and pages in
cms_blockandcms_page, sometimes in a block that only appears on the checkout. - Widgets and Page Builder content that contain an HTML element with a script inside.
In files
- Theme JavaScript and
requirejs-config.js, where one extra dependency loads the skimmer. - Payment module templates, edited to add a fake card form or to copy the real one.
- Deployed static files in
pub/static, which get overwritten on the next deploy, so the attacker re-injects them from a backdoor.
The tricks that make them hard to see
- Checkout only: the script loads only on the checkout URL, so scanning your home page finds nothing.
- Visitor filtering: no payload for admin users, known scanner IP addresses or returning visitors.
- Look-alike domains: the data goes to a domain that resembles a payment provider or analytics service.
- WebSockets and image requests: stolen data leaves through channels that network filters often ignore.
- Server-side backdoors that hide themselves: our analysis of the StyleSmuggler implant showed a PHP backdoor that returns a real 404 to everyone except the attacker.
Why outside scans miss them
An external scanner sees what your store sends to one anonymous browser at one moment. A skimmer built to load only on checkout, only for real shoppers, or only once per visitor is simply not in that response. Backdoors, malicious database rows and unexpected PHP files in upload folders are never in any response at all. You need a check that runs on the server.
How to check your store
1. Search the database
Run these against your Magento database. A legitimate store can have scripts here (analytics, chat widgets), so review every hit rather than deleting it.
-- Scripts in configuration fields that print into every page
SELECT config_id, path, scope, scope_id
FROM core_config_data
WHERE value LIKE '%<script%' OR value LIKE '%atob(%' OR value LIKE '%eval(%' OR value LIKE '%fromCharCode%';
-- Scripts in CMS blocks and pages
SELECT block_id, identifier FROM cms_block WHERE content LIKE '%<script%';
SELECT page_id, identifier FROM cms_page WHERE content LIKE '%<script%';
2. Look for recently changed and out-of-place files
# PHP files changed in the last 7 days, outside generated and cache folders
find . -type f -name '*.php' -mtime -7 -not -path './var/*' -not -path './generated/*' -not -path './pub/static/*'
# PHP files where only images and documents belong
find pub/media -type f -name '*.php*'
3. Compare core and vendor code with a clean copy
Install the same Magento version and the same extensions in an empty folder with Composer, then compare vendor/. Any difference in a core or third-party file you did not patch yourself needs an explanation.
4. Watch the checkout as a shopper
Open the checkout in a private window with the browser's developer tools on the Network tab, go as far as the payment step, and look for requests to domains you do not recognise.
5. Turn on a strict Content Security Policy
Magento's built-in Content Security Policy can restrict which domains may load scripts and receive data on payment pages. Recent Magento 2.4 versions enforce it on checkout payment pages, in line with PCI DSS 4.0. A strict policy will not remove an infection, but it can stop data from reaching the attacker's server.
If you find a skimmer
- Do not just delete it. Attackers almost always leave more than one way back in.
- Take a snapshot of files and the database, so you keep the evidence.
- Rotate every credential: admin users, database, SSH, API integrations and payment keys.
- Close the way in: apply the missing security release or replace the vulnerable extension. See our Magento upgrade and security patch service.
- Scan again and keep monitoring. Re-infection within days is common when a backdoor was missed.
- Tell your payment provider. Card data was exposed, and they will tell you what is required next.
Frequently asked questions
Does a hosted payment page protect me from Magecart?
It reduces the risk, because card details are typed on the provider's page. Attackers respond by showing a fake card form before the redirect, so you still need to check your checkout.
Will my antivirus or hosting malware scan find it?
Often not. Most generic scanners check files only, and skimmers on Magento very often live in the database.
How often should I scan?
At least after every deployment and every Adobe security bulletin. Stores hosted with us are scanned automatically every night.
Can you clean an infected store for us?
Yes. We contain the infection, clean files and database, close the entry point and harden the server. See our upgrade and security patch service.




