WordPress · Drupal · Site Maintenance · Technical SEO · Editorial Policy

How to Check a Magento Site for Backdoors and Unauthorised Access

A Magento store holds customer records, order data and a checkout page, so unexpected access matters more here than on a brochure site. A backdoor is any way back into the store that you did not put there: an admin account, an API token, a scheduled job, a changed file or a script saved in the admin. This guide covers how to look for each, how to clean up, and how to make sure the same access cannot return.

The steps apply to Magento Open Source and Adobe Commerce. Where a feature depends on your edition or hosting, the text says so.

Before you start: preserve evidence and limit changes

If you suspect a compromise, avoid deleting things straight away. First take a full copy of the code directory and a database dump, and keep your web server and PHP logs. These copies let you work out how someone got in, which matters because cleaning up without fixing the entry point usually means the problem returns.

If you are on Adobe Commerce on cloud infrastructure, check what access and logs your plan gives you, and contact Adobe support early. If you are on your own server or a managed host, your host may be able to supply access logs and file-level snapshots.

Consider putting the store into maintenance mode while you work, especially if you suspect the checkout page has been altered.

Check admin accounts and roles

In the admin panel, open System, then Permissions, then All Users. Look for accounts you do not recognise, accounts for people who have left, and generic names that were never assigned to anyone. Also open User Roles and check whether an ordinary role has quietly gained broad resource access.

An attacker with database access can also create an admin user without the admin panel, so the list is worth comparing against a list your team actually maintains.

  • Disable or delete any account nobody can vouch for.
  • Reset passwords for every remaining admin, not only the suspicious ones.
  • Check that two-factor authentication is enforced for all admin users. Magento ships a two-factor authentication module; confirm it is enabled on your installation and not disabled in the module list.
  • Review the admin URL. If it is still the default, change it to a custom path in your configuration.

Adobe Commerce also includes an admin action log, which can show who changed what and when. Open Source does not include it in the same form, so there you rely more on server and database logs.

Review integrations, tokens and connected apps

Magento lets third-party systems connect through integrations. Open System, then Extensions, then Integrations. Each entry has its own access tokens and permitted resources. Delete any integration you do not recognise and review the resource scope of the ones you keep. An old integration for a retired vendor is a common leftover.

Tokens are not limited to this screen. Admin and customer tokens issued through the REST and GraphQL APIs have their own lifetimes, which you can review in your store configuration under the web API and admin security settings. Shorter lifetimes reduce how long a stolen token stays useful.

Also review anything that holds credentials for your store outside Magento: payment gateway portals, shipping and ERP connectors, marketing platforms, and any service that can call your API. Revoke access you no longer use.

Look at scheduled tasks and outgoing connections

Magento relies on cron to run indexing, emails and many extension jobs. Two places are worth checking.

  1. The server crontab for the user that runs the store. Magento normally needs only its own cron entries. Anything else that downloads or runs remote content deserves scrutiny.
  2. The scheduled job records in the database, which list the job codes that Magento and its modules have queued. A job code that no installed module defines is a warning sign.

Then check for outgoing behaviour. If your edition and version support webhooks, review the configured endpoints and remove any you did not set up. Also check your firewall or hosting logs for outbound connections to unfamiliar hosts.

Inspect files, modules and stored scripts

Most Magento backdoors live in code or in content that outputs script. Check these in order.

  • Compare against a clean source. If your project is managed with Composer and version control, run a diff against the last known-good commit. Any file in the code tree that differs without a matching deployment is suspect.
  • List installed modules. Use the command line to list module status and compare it with the extensions you actually bought or built. Look in the custom code directory for modules nobody remembers.
  • Search for risky PHP functions in custom and writable locations, such as ones that evaluate encoded strings or run shell commands. Legitimate code rarely does either.
  • Check writable directories such as media and var for PHP files. Those folders should hold uploads and generated data, not executable code.
  • Check recently modified files. A file changed outside your deployment window is worth reading.
  • Review core configuration files, including the environment and configuration files under the app directory, for unexpected entries.

Checkout skimming scripts often avoid the file system entirely. Open the design configuration under Content, then Design, then Configuration, and check the HTML head and footer script fields. Also review CMS pages and static blocks for script tags you did not add. Finally, open your checkout page in a browser, use the developer tools network panel, and look for requests to unfamiliar domains.

Remove access and rotate credentials

Once you have located the entry point and the leftovers, clean up in this order.

  1. Restore modified core and vendor code from a trusted source rather than hand-editing it. Reinstall dependencies from your Composer files.
  2. Delete unknown modules, files and scripts, then flush caches and regenerate compiled code.
  3. Remove rogue admin users, integrations and tokens.
  4. Change every password: admin users, database, hosting panel, SSH or SFTP, and email accounts used for password resets.
  5. Change the database credentials and update the environment file to match.
  6. Generate a new encryption key from the admin under Stores, then Other Settings, then Manage Encryption Key. Plan this carefully, since it re-encrypts stored values.
  7. Rotate keys held by payment gateways, shipping carriers and any other API partner.
  8. Install the latest security patches Adobe has published, and keep extensions updated.

After this, watch logs closely for several days. A returning admin account or modified file means the entry point is still open.

Reduce the chance of a repeat

Keep a short routine: apply Adobe security patches when they are released, remove extensions you do not use, restrict admin access by IP or VPN where you can, and file integrity-monitor the code directory. Adobe lists its security bulletins on its security page, and OWASP provides general guidance on web application hardening.

Official references: Adobe Security Bulletins, Adobe Commerce documentation and OWASP.

Frequently asked questions

How do I know if my Magento store has been hacked?

Common signs include admin users you did not create, files that changed outside a deployment, unfamiliar scripts on the checkout page, and unexplained cron jobs or outgoing connections. None is proof alone, so check several of the areas above.

Can I run these checks myself or do I need a developer?

Reviewing admin users, integrations and stored scripts can be done from the admin panel. File comparison, cron inspection and database checks need command line or server access, so a developer or your host should help with those.

Is removing the malicious file enough?

No. A deleted file does not close the hole that let it in, and the attacker may have left other access behind. Find the entry point, patch it, and rotate every credential.

We use essential cookies to make this site work and remember your preferences. We do not use advertising or analytics cookies. Privacy Policy. Cookie Policy.