Fix Library: Security

Magento Store Hacked: First 60 Minutes Checklist

Last updated:

What you see

Something is wrong. A customer reported card fraud, a scanner flagged the site, or there is an admin user nobody recognises.

Quick answer

Keep the evidence, close the obvious doors and find out how far the attacker got, in that order. Do not delete files or restore an old backup first: both destroy evidence, and the backup may hold the same backdoor. The checks below are read only and safe to run straight away.

What usually causes it?

  1. Missing Adobe security patches, for example the APSB26-146 hotfix for CVE-2026-75650, which Adobe says is exploited in the wild, or the SessionReaper fix (APSB25-88)
  2. A leaked or reused admin password, without two factor authentication
  3. A vulnerable or abandoned extension
  4. Old developer or agency accounts that were never removed

How do you check it safely?

These checks only read information. Run them on staging first if you can, from the Magento root folder as the file system owner. Hosting setups differ, so paths and service names may need adjusting.

  1. Ask your host for a full snapshot of files and database before anyone changes anything. Keep it as evidence.
  2. List admin users, newest first. Look for names, emails or creation dates you do not recognise.
    SELECT user_id, username, email, created, logdate, is_active
    FROM admin_user ORDER BY created DESC;
  3. Look for scripts injected through configuration, a common place for card skimmers.
    SELECT scope, scope_id, path, LEFT(value, 200) AS value
    FROM core_config_data
    WHERE path IN ('design/head/includes', 'design/footer/absolute_footer')
       OR value LIKE '%<script%';
  4. Check CMS blocks and pages for script tags.
    SELECT block_id, identifier FROM cms_block WHERE content LIKE '%<script%';
    SELECT page_id, identifier FROM cms_page WHERE content LIKE '%<script%';
  5. List code files changed in the last 7 days, outside generated folders.
    find . -type f \( -name '*.php' -o -name '*.phtml' -o -name '*.js' \) -mtime -7 \
      -not -path './var/*' -not -path './generated/*' -not -path './pub/static/*'
  6. Look for PHP files where only images and uploads should be.
    find pub/media -type f -name '*.php'
  7. If the code is in Git, compare the server with the repository.
    git status --short
  8. On Adobe Commerce Cloud, check whether the APSB26-146 hotfix (VULN-39341) is applied, with the Quality Patches Tool command from Adobe's article.
    vendor/bin/magento-patches -n status | grep "39341\|Status"

How do you fix it?

These steps change your store. Run them on staging first, with a backup of code and database.

  1. If card data may be at risk, close the shop to customers while you work, allowing only your own IP address.
    bin/magento maintenance:enable --ip=YOUR.IP.ADDRESS
  2. Disable unknown admin users, then reset every remaining admin password. Keep two factor authentication on (Magento_TwoFactorAuth is enabled by default in 2.4).
  3. Rotate hosting, SSH, SFTP and database passwords, integration and API tokens, and payment gateway keys.
  4. Remove the malicious code. The safest way is to redeploy clean code from Git and composer, not to edit infected files one by one.
  5. Remove injected scripts from configuration and CMS content found in the checks above, then flush the cache.
    bin/magento cache:flush
  6. Apply all missing Adobe security patches before reopening, or the attacker can come back the same way. Start with the APSB26-146 hotfix for CVE-2026-75650 if it is missing.
  7. If the APSB26-146 hotfix was missing, rotate your encryption key and every credential it protected, such as server, API, integration and payment gateway credentials, at their source. Adobe notes that rotating the key alone does not invalidate credentials that may already have been exposed.
  8. Tell your payment provider if card data may have been exposed, and check your legal duties for personal data breaches.
  9. Reopen the store and keep watching files and admin logins for the next weeks.
    bin/magento maintenance:disable

When should you call an expert?

Call an expert if you find a skimmer or backdoor, if you cannot tell how the attacker got in, or if your payment provider asks for an investigation. Cleaning up without closing the entry point usually means a second infection.

Need it fixed today?

I can look at it with you. Book a 20 minute call, or if the store is down, see emergency Magento support.

Further reading

FAQ

Common questions.

Can I just restore last month's backup?

Not on its own. The attacker may have been in the store for longer than a month, and the hole they used is still open. Restore only after the entry point is found and patched.

Should I reinstall Magento from scratch?

Usually not. Redeploying clean code from Git and composer has the same effect, as long as the database, media folder and credentials are cleaned as well.

Rather have it fixed for you?

Send a few lines about the problem, or book a 20 minute call. You get an honest read and a fixed quote.

Book a 20 minute call Reply within a few hours, 7 days a week.