Malware Scanner & File Integrity Monitor for Magento 2
Guard plugins that reject suspicious uploads and API requests, plus a scheduled scan that flags files matching malware signatures, logs them in the admin and can quarantine critical finds in upload folders.
- Free
- Themes listed: Hyvä + Luma
composer require mage2kishan/module-malware-scanner
- Package requirementsRead the source documentation
- Developer profileView Upwork profile
- Themes listedHyvä + Luma
- PHP versions listed8.1, 8.2, 8.3, 8.4
- Installation questionsDiscuss your store setup
What it does for your store
The main features, as listed in the module documentation.
-
Request guards
Upload, REST, GraphQL, custom option and media path checks reject files and requests that match built-in indicators.
-
Signature scan on disk
Filename, path glob, hash, literal and regex signatures for webshells, polyglot images and backdoor code.
-
Quarantine with limits
Critical finds inside upload folders move to a locked quarantine folder; a Report Only mode moves nothing.
-
Findings and blocked requests
Admin grids for scan findings and blocked requests, with review, quarantine, delete and ignore actions.
-
Scheduled scans and email
Daily cron scan by default, a console command and an optional findings email once recipients are set.
Installation
Example commands from the Magento root. Follow the package instructions and your staging and deployment process.
- 1Check the releaseMatch Magento, PHP, theme and dependency requirements.
- 2Install on stagingReview Composer changes and follow the package instructions.
- 3Configure and verifyUse the documented settings and test the affected features.
$ composer require mage2kishan/module-malware-scanner $ bin/magento setup:upgrade $ bin/magento setup:di:compile $ bin/magento setup:static-content:deploy -f $ bin/magento cache:clean
Listed requirements
These are the details supplied in this listing. Confirm the selected release supports your Magento edition, PHP and storefront.
| Magento versions listed | 2.4.6, 2.4.7, 2.4.8 |
|---|---|
| PHP versions listed | 8.1, 8.2, 8.3, 8.4 |
| Themes listed | Hyvä, Luma |
| Composer package | mage2kishan/module-malware-scanner |
Documentation
Product details and setup guidance. Check the package repository for release-specific instructions.
What the malware scanner does
Panth Malware Scanner adds two checks to a Magento 2 or Adobe Commerce store. Guard plugins inspect file uploads, REST and GraphQL requests, storefront request paths and cart custom-option payloads while a request runs, and reject anything that matches a built-in list of indicators. A scheduled scanner then walks the folders you configure on disk, records every file that matches a signature in an admin grid and can move critical finds inside upload folders to a quarantine folder.
The package user guide describes the module as one layer of a defense-in-depth setup that does not replace Magento security patches, a web application firewall, backups or a security audit. A scan that finds nothing does not prove that a store is clean.
Request guards
The guards hook Magento upload classes, the REST and GraphQL controllers, product and cart custom options, customer file uploads, admin catalog image uploads, pub/get.php media requests and the storefront front controller. They look for PHP open tags inside image files, known webshell names and hashes, eval of base64_decode style code, StyleSmuggler request markers and the class names used in known PHP object-injection payloads.
- A blocked upload is rejected and its temporary file is deleted.
- A blocked REST or GraphQL request is rejected; a blocked storefront or media path gets an empty 404.
- Every block is written to a Blocked Requests grid with the source IP, URI, matched indicator and a short excerpt.
- A payment guard, on by default, rejects selected PayPal and Braintree GraphQL payment mutations when none of the related payment methods is active.
If a guard hits an internal error while inspecting a request, the request is allowed to continue. Plan your other protections with that in mind.
On-disk scan and findings
The scanner reads each file with a configured extension in the scan paths, hashes it with SHA-256 and checks it against filename, path glob, hash, literal and regex signatures. Signatures cover PolyShell webshells, polyglot image files, eval of base64_decode backdoors, .htaccess PHP handlers, StyleSmuggler markers, known implant names and hashes, command-and-control hosts and INSERT INTO admin_user statements. You can add extra command-and-control domains and attacker IP addresses in the admin.
Only files that match a signature are stored. The module does not keep a hash baseline of every file, so it is not a full file integrity monitor. When a flagged file changes, or a quarantined or deleted file comes back, its finding is reopened as new.
- Scan Findings grid with severity, path, matched signatures, status and first and last seen times.
- Row and mass actions to view a file, quarantine it, delete it or mark it as a false positive.
- Run Scan Now in the admin, a cron job (daily at 03:00 by default) and the bin/magento panth:malware:scan command.
- A Report Only (Dry Run) setting that records findings without moving any file.
Quarantine and alert emails
Auto-quarantine is on by default. During a scan, a file with a critical match inside a quarantine zone (pub/media, var/import, var/export and var/importexport by default; var/tmp is excluded from scans by default) is copied to var/panth_malware_quarantine/ with a .quarantined suffix and mode 0600, and the original is removed. Code folders such as app, vendor and generated are never auto-quarantined, even if you add them. Files outside the zones are only reported. Try Report Only first on a staging copy so you can review what would be moved.
After a scan the module can email a summary of new findings at or above a minimum severity, which is High by default. No email is sent until you enter at least one recipient address in the configuration. Blocked requests are logged in the admin but do not trigger emails.
Customer upload controls
An extension allowlist rejects customer and customer address uploads whose file extension is not allowed, whatever the file contains. An optional hourly cron job, off by default, deletes files with non-allowlisted extensions from the customer, customer address and custom options media folders and logs each deletion.
Requirements and installation
The installed 1.3.8 release lists Magento Open Source and Adobe Commerce 2.4.4 to 2.4.8 and PHP 8.1 to 8.4. It needs the free mage2kishan/module-core package, which Composer installs, and a working Magento cron for scheduled scans. Install it on a staging copy first with composer require mage2kishan/module-malware-scanner, then run setup:upgrade, setup:di:compile and static content deployment for the admin stylesheet.
The settings live under Stores, Configuration, Panth Extensions, Malware Scanner. Uninstalling the module leaves its two database tables, its configuration rows and any quarantined files in place, so remove those by hand if you no longer need them.
License and source
The module is free and open source under the MIT license. Read the package README and the user guide for the release you install, including the nginx rules the guide suggests for customer upload folders.
Developer notes
These names are from release 1.3.8 of the package.
- Module
Panth_MalwareScanner, namespacePanth\MalwareScanner. - File signatures, inline and base64 needles, implant hashes and the built-in allowlist are in
Model\SignatureProvider. Request-side patterns are inModel\AttackPatternDetectorandModel\RequestInjectionDetector. Model\Scannerevaluates files,Model\FileAccesshandles quarantine, purge and safe reads,Model\Notifiersends the alert email andModel\BlockedRequestLoggerwrites blocked-request rows.- The GraphQL payment guard map is the
guardedOperationsargument ofPlugin\GraphQl\PaymentMethodGuard. Add items to it from another module'setc/graphql/di.xml. - Cron:
panth_malwarescanner_run(Cron\RunScan, schedule read frompanth_malwarescanner/cron/schedule) andpanth_malwarescanner_purge_uploads(Cron\PurgeNonAllowlistedUploads,23 * * * *). - Admin route
panth_malwarescanner. UI listingspanth_malware_scan_listingandpanth_malware_blocked_listing. - ACL resources:
Panth_MalwareScanner::malware,::scan_view,::scan_run,::scan_delete,::scan_view_file,::blocked_log,::configand::system_config. - Tables:
panth_malware_scan_resultandpanth_malware_blocked_request. - Alert email template:
panth_malwarescanner_notification_template.
| Module Category | Security |
|---|---|
| Best For | Mid-Market |
Changelog
-
1.3.8, 2026-10-30
- Released under the MIT License: this module is free and open-source software.
-
1.3.7, 2026-10-05
- A finding quarantined from the grid or by auto-quarantine kept its Quarantined status only until the next scan, which relabelled it "Clean (file no longer on disk)" and showed it in the grid again; quarantined findings now stay quarantined.
- A file that was quarantined, deleted, clean or excluded and then planted again with the same content stayed closed and sent no alert; it is now reopened as New and emailed.
- The alert email listed signatures as raw JSON and pointed to a menu path that does not exist; it now shows the signature IDs as text and the real path Panth Infotech -> Malware Scanner -> Scan Findings (also corrected on the documentation page and in USER_GUIDE.md).
- The Status column of Scan Findings and the Request Type column of Blocked Requests showed raw codes instead of their labels.
FAQ
How is this different from a traditional antivirus?
It is written for a Magento install. The signatures and guards target Magento upload folders, REST and GraphQL endpoints and known Magento attack patterns such as PolyShell webshells and StyleSmuggler requests, and the findings appear in the Magento admin. It is not a general antivirus and does not replace host level scanning, security patches or a firewall.
Does it prevent attacks or only detect them?
Both, within limits. Guard plugins reject matching uploads and REST, GraphQL and storefront requests while they run, and the scheduled scan finds matching files already on disk. A guard that hits an internal error lets the request continue, and only known indicators are matched, so keep Magento patched and use a firewall as well.
Will it slow down my store?
The on-disk scan runs from cron, daily at 03:00 by default, or on demand. It reads each file with a configured extension in the scan paths in full, skipping excluded paths and files over the size limit (2048 KB by default), so scan time depends on the size of your install. The request guards add checks to uploads and API requests; test them on staging with your own traffic.
Can I add my own threat indicators?
There is no signature file to merge. The shipped signatures live in the Model\SignatureProvider class. In the admin you can add extra command-and-control domains, attacker IP addresses and allowlist paths without a module update.
What happens to quarantined files?
Auto-quarantine is on by default. A file with a critical match inside a quarantine zone is copied to var/panth_malware_quarantine/ with a .quarantined suffix and mode 0600, and the original is removed. Quarantined files stay there until you remove them. Set Report Only (Dry Run) to Yes if you want scans to log findings without moving files.
Does it work on Adobe Commerce Cloud?
The package lists Adobe Commerce 2.4.4 to 2.4.8 but does not document Adobe Commerce Cloud. The quarantine folder is fixed at var/panth_malware_quarantine/ and scans need Magento cron, so check write access and cron on a Cloud staging environment before production.
Is the source code available?
Yes. Source is on GitHub at github.com/mage2sk/module-malware-scanner.
Does it require Panth Core?
Yes. Panth_Core is a free required dependency, Composer installs it automatically.
Questions before you install?
Send me your composer.json and I will check for conflicts first. Free. Installation is +$45, custom work is quoted first.