Content management and web applications
Magento and Adobe Commerce
Magento, Adobe Commerce and Mage-OS: PolyShell, CVE-2026-71362, StyleSmuggler and BlockStrap
Magento exploited-flaws check, hunt and upload-folder guard
Four flaws hit Magento Open Source, Adobe Commerce and Mage-OS in 2026, and three of them were attacked before most stores had patched. Each has its own fix, and one of them changes no version string, so a store can look current and still be open. The script judges each flaw separately, looks for what the attacks leave behind, and closes the folder PolyShell writes into.
| Flaw | What it does | Exploited | Fixed in |
|---|---|---|---|
| CVE-2026-48356, PolyShell | Unauthenticated file upload through the guest-cart REST API (/V1/guest-carts/:cartId/items). A polyglot, a valid GIF or PNG with PHP inside, lands in pub/media/custom_options/quote/; where the web server runs PHP from there, it is remote code execution. CVSS 9.3 |
Since March 2026; CISA KEV 27 October 2026 | July 2026 releases (APSB26-73, -2026-jul); Mage-OS 2.2.1 and every 3.x |
| CVE-2026-71362 | Customer account takeover without authentication (incorrect authorization). CVSS 9.1 | Shortly after disclosure; CISA KEV 24 September 2026 | August 2026 releases (APSB26-92, -2026-aug); Mage-OS 3.4.0 |
| CVE-2026-75650, StyleSmuggler | Unauthenticated remote code execution through template styles parameters, in two stages: PHP stored in a report or log file, then included through a GraphQL gadget chain. CVSS 10.0 |
From 4 September 2026, three days before the fix; CISA KEV 8 September 2026 | Only Adobe's hotfix VULN-39341 (APSB26-146, 7 September 2026); Mage-OS 3.5.0 |
| CVE-2026-103849, BlockStrap | A bypass of the StyleSmuggler fix through a second-pass directive in email templates. CVSS 10.0 | Not confirmed in the sources used here | October 2026 releases (APSB26-153, -2026-oct); Mage-OS 3.6.0 |
The October release does not include the StyleSmuggler hotfix. Sansec states that the October patch does not carry VULN-39341 and that Adobe's patch registry does not list it as a prerequisite; Adobe recommends applying both. A store on 2.4.8-2026-oct without the hotfix is still open to StyleSmuggler.
Adobe published no fix for any of the four below Adobe Commerce and Magento Open Source 2.4.4. Scandiweb backported the StyleSmuggler fix to 41 older releases (2.2.0 to 2.4.3-p3); those patches are not reviewed here.
What a version number can and cannot show
Adobe ships these fixes as full releases with a dated name (2.4.9-2026-oct), as isolated patches and as a hotfix, and the last two do not change the version string. The script gives a firm answer where one exists and names what to confirm where it does not:
| Install | PolyShell | CVE-2026-71362 | StyleSmuggler | BlockStrap |
|---|---|---|---|---|
Dated release -2026-jul or later |
Fixed | August or later: fixed | Needs evidence of the hotfix | October or later: fixed |
| Dated release before that | Exposed | Exposed | Needs evidence of the hotfix | Exposed |
Any other Magento or Adobe Commerce 2.4.4 to 2.4.9 version (2.4.8-p5, 2.4.9) |
Confirm | Confirm | Needs evidence of the hotfix | Confirm |
| Below 2.4.4 | Out of Adobe support: exposed | |||
| Mage-OS | 2.2.1 or later | 3.4.0 or later | 3.5.0 or later | 3.6.0 or later |
Sources disagree on plain 2.4.9: Sansec reports that the May release of 2.4.9 carried the PolyShell fix, while Adobe's bulletin and the CVE record list 2.4.9 as affected and 2.4.9-2026-jul as fixed. The script follows Adobe and asks you to confirm.
For StyleSmuggler, the script looks for evidence that the hotfix was applied: VULN-39341 in composer.json (a cweagans/composer-patches entry), composer.lock or .magento.env.yaml, a patch file in m2-hotfixes/ or patches/ that names it, or the disrex/stylesmuggler-adobe-patches package, which applies Adobe's patch through Composer. A reference is evidence, not proof; confirm with Adobe's tool:
vendor/bin/magento-patches -n status | grep "39341\|Status"
The ceymox/module-style-smuggler-shield module and a CLI-only guard in the DI ArrayScanner are reported as community mitigations, not as the fix.
The upload folder
PolyShell writes into pub/media/custom_options/ whether or not the server ever runs the file. Whether the upload becomes code execution depends on the web server: on nginx a location ~ \.php$ that comes first, or a plain prefix rule it overrides, sends /media/custom_options/.../index.php to PHP-FPM. The check reads:
- nginx (when nginx runs, or
WEB_SERVERS=nginx): every configuration file under the usual folders and every absolute file they include (the store'snginx.conf.sampleincluded), for alocationnamingcustom_optionsthat denies (deny all,return 403,404or444). A^~prefix wins wherever it is; a regex location must come before the first PHP regex location in its file; a plain prefix is overridden by a PHP regex location and is reported as not closing the folder. Anincludeof the guard snippet counts; the snippet file on its own does not. Files that are links are not read. - Apache and LiteSpeed (when they run, or with no server seen):
pub/media/custom_options/.htaccessmust deny all access (Require all denied, orDeny from all), comments aside. An.htaccessthat only turns the PHP engine off still serves the file. A link is reported, not read. - The folder itself: files already in it are counted, and any PHP file or file carrying PHP code is reported as a compromise.
On a release that carries the fix, an open folder is a warning (defense in depth); on any other, it is critical.
Quick start
curl -fLO https://raw.githubusercontent.com/PrivacySafe/security-patches/refs/heads/main/web-apps/magento/magento-check.sh
less magento-check.sh
chmod +x magento-check.sh
./magento-check.sh check
sudo ./magento-check.sh hunt
sudo ./magento-check.sh mitigate --dry-run
By default it looks for bin/magento under /var/www /srv /home /opt. Pass directories to narrow it.
| Command | What it does |
|---|---|
check (default) |
Read-only. Finds installs, reads the distribution and version from composer.lock (or composer.json for a git checkout), judges the four flaws, looks for hotfix evidence, and reads the upload-folder rules. Also reads installs in running docker and podman containers (SCAN_CONTAINERS=1, the default); for those, the container's web server rules are not read. Exit 0 nothing exposed, 1 exposed or unconfirmed |
hunt |
Read-only. Looks for what the attacks leave behind (next section). Exit 0 nothing found, 1 findings or leads |
mitigate [--dry-run] [--no-nginx] [DIR ...] |
Root. Writes pub/media/custom_options/.htaccess where it is missing or does not deny, and the nginx guard /etc/nginx/snippets/psf-magento-guard.conf. Includes nothing and reloads nothing |
rollback [--dry-run] |
Root. Puts back every file mitigate changed and removes the files it created |
version |
Prints the script version |
Settings: HUNT_DAYS (30), SCAN_CONTAINERS (1), WEB_SERVERS (the servers to judge, nginx, apache or both; default: the running ones), NGINX_DIRS, NGINX_SNIPPET_DIR (/etc/nginx/snippets), LOG_DIRS, STATE_DIR (/var/lib/psf-security-patches/magento-check), PSF_LOCK_WAIT (30).
Hunt
Indicators come from Sansec's PolyShell and StyleSmuggler research and the disrex StyleSmuggler incident notes. Addresses rotate within days: a match is a lead, and a miss proves nothing. A finding (CRIT) is something a stock store does not have; a lead (WARN) is an attempt or a pattern worth reading.
In each store:
- Files in the upload folder that are PHP or carry PHP code, with polyglot images named as such (Sansec's commonest drop is a
GIF89afile called780index.php, the option ID beforeindex.php). - Any PHP file under
pub/media, which holds none in a stock store, including the second StyleSmuggler crew'spub/media/catalog/product/cache/ss_<hex>/sync_<hex>.php. - The
accesson.phpbackdoor, which the PolyShell crew sprays intoassets/images/folders inside every top-level folder it can write to, and any PHP in such a folder. - Webshell and beacon strings in PHP outside the packages: the
8194460beacon (409723*20), the two webshell password hashes, the second crew'sX-Cache-Tokenvalue, thegl_google_advisor_cookie, and the stage-one labelsMGPROOF::andMGKWSIM::. vendor/magento/framework/App/View.phpreading a cookie or decoding base64, which is the cookie-triggered remote include Sansec found.- PHP code or StyleSmuggler markers stored in
var/report/(stage one of the chain), PHP open tags invar/log/*.log, and theexception.logsignatures: LaminasClassMapAutoloadererrors (one per stage-two attempt;Map file provided does not existmarks a failed include),Requested store is not found (<?(the recon probe), and a GraphQL error about a$guardvariable no Magento schema declares. mgproof717.txt, and the gs-netcatdefunctanddefunct.datfiles.
On the host:
- A process whose name is a bracketed kernel-thread name but which runs a real program: kernel threads have no command line and belong to root, so
[kworker/u:8:0]on a site account is the StyleSmuggler implant. - A process with a system name (
fc-cache,chronyd,gvfsd-user,kworker,sshd,bash) running a binary from/tmp,/var/tmp,/dev/shm,~/.local/share/.gvfsd/or~/.cache/fontconfig/; achronydthat does not run from a system folder; ansshd: <user>@nottywhose parent is PID 1 (the WraithC2 disguise). - The published drop paths (
/tmp/.kw_*,/tmp/.fc-<hex>/fc-cache,/tmp/.fc_<hex>.lock,/tmp/.chrony-<hex>/chronyd,~/.local/share/.gvfsd/gvfsd-user,~/.cache/fontconfig/fc-cache) and the php-fpm private/tmpdrops (.dbus-session-*,.pipewire-session-*,.dbus/.c2,.gsusr-*/defunct,adminer.version). - Cron entries for those binaries, read from the spool files themselves, because the implant writes the spool directly and leaves no syslog line.
- SHA-256 of every file and running binary it flags, against the published hashes.
- Open connections to the published command servers.
In the access logs (nginx, Apache, LiteSpeed, /var/www and /home, last HUNT_DAYS days, compressed files included): PHP requested from the upload folder and answered 200 (a finding), accesson.php or a cache shell answered 200, probes for PHP in the upload folder, addresses that posted to a guest cart and then requested the upload folder, StyleSmuggler requests (styles[, template_styles, generatorClass, with_resolved, PHP in the PayPal response query), and the published source addresses.
In the database, which the script does not open: the crews store skimmer loaders in CMS blocks and pages and in the HTML head setting, and Sansec found a fully patched store compromised through a rogue administrator. hunt prints read-only queries for cms_block, cms_page, core_config_data (design/head/*) and admin_user, with the published loader domains. Add your table prefix if the store uses one.
If hunt finds anything: keep the evidence (do not reboot; /proc/<pid>/exe can be the only copy of a deleted binary), remove the cron entries before stopping the processes, and rotate the encryption key and every credential it protected, at the source: admin passwords, integration and OAuth tokens, payment gateway credentials, database credentials, SSH and deploy keys. Rotating the key alone does not undo what was already read.
Mitigate
mitigate closes the upload folder. It is a guard, not a fix: uploads still reach the disk until the July 2026 fix is in, and StyleSmuggler needs the hotfix.
.htaccess: written in every install where it is missing or does not deny, with the PHP engine off and all access denied (Require all denied, andDeny from allfor servers withoutmod_authz_core). Magento serves customer uploads through its own controller, which this does not affect. The file is written as the account that owns the folder (withsetpriv, orrunuser), so a link the web account plants cannot turn it into a root write elsewhere. Inside the folder nothing follows a link: the folder is opened withO_NOFOLLOW, a new file is created withO_EXCLbeside the target and renamed over it, and an.htaccessor acustom_optionsthat is a link is reported and left alone. An existing file is copied toSTATE_DIRfirst, and its mode is kept. A missingcustom_optionsfolder is created by the owner ofpub/media.- nginx snippet:
/etc/nginx/snippets/psf-magento-guard.confcloses the upload folder and any PHP undermedia(under both/media/and/pub/media/), and closes the connection (444) on the StyleSmuggler query strings, raw and percent-encoded, PHP in the query string, and PHP in theUser-AgentorStoreheader. Nothing includes it and nothing is reloaded. Add it at the top of each Magentoserverblock, above every PHP location, then test and reload:
server {
include snippets/psf-magento-guard.conf;
# ... the store's own locations follow
}
sudo nginx -t && sudo systemctl reload nginx
The query-string rules stop the requests seen in the wild. The same parameters sent in a POST body pass them, which is why they do not replace the hotfix.
On Apache, the StyleSmuggler requests can be closed with mod_rewrite in the store's virtual host (the same caveat applies):
RewriteEngine On
RewriteCond %{QUERY_STRING} (styles(\[|%5B)|template_styles|generatorClass|with_resolved|<\?|%3C%3F) [NC]
RewriteRule ^ - [F]
RewriteCond %{HTTP:Store} <\? [OR]
RewriteCond %{HTTP_USER_AGENT} <\?(php|=) [NC]
RewriteRule ^ - [F]
rollback restores each copied file (newest run first, so the true original comes back last) and removes the files mitigate created, unless a created file was changed since, which it reports and leaves for you. Then remove any include line you added.
Update
- Adobe Commerce and Magento Open Source 2.4.4 to 2.4.9: move to the October 2026 release for your line (
-2026-oct), which carries the PolyShell, August and BlockStrap fixes, and apply hotfix VULN-39341 from APSB26-146 as well. - Mage-OS: 3.6.0 or later.
- Below 2.4.4: no Adobe fix exists; upgrade.
- Every environment that faces the internet, staging included.
Sources
- Sansec: PolyShell: the upload path, affected web server setups, payloads, filenames,
accesson.php, loader domains and scanner addresses - Sansec: StyleSmuggler: the two stages, the implants, persistence, the second crew and the indicators
- Sansec: BlockStrap: including that the October patch does not carry VULN-39341
- disrex: StyleSmuggler mitigation notes: the process check, the query-string patterns and further indicators
- Adobe APSB26-153; Adobe APSB26-146, APSB26-92 and APSB26-73
- Experience League: APSB26-146 hotfix
- Mage-OS 3.4.0, 3.5.0 and 2.2.1 release notes
- Scandiweb: Magento security news: the CISA listing dates
Before you run it
- The hotfix needs evidence. No release carries VULN-39341, so a dated or current version never settles StyleSmuggler. A reference in the project files is evidence; Adobe's
magento-patches statusis the confirmation. - A clean hunt is not a clean store. The script does not read the database, does not see stores in other containers' file systems beyond the files it copies for
check, and reads only the logs it can reach; run it as root, and run the printed queries. - The nginx reading is a static reading. It follows absolute
includepaths but not relative ones, does not evaluateiformap, and judges the order of locations within one file.nginx -Tshows the configuration as nginx sees it. - The
.htaccessneedsAllowOverride. Apache ignores it where overrides are off; then put the same rules in the virtual host. - mitigate needs python3 and
setprivorrunuser. It refuses to write a store folder without switching to its owner. - A Mage-OS pre-release is not the release:
3.6.0-rc1is reported with a warning. - It also checks running docker and podman containers, unless you name a directory or set
SCAN_CONTAINERS=0. It copies only the files it reads into a private temporary directory, never runs anything in a container beyondfindand a file copy, and never keeps a staged link.
Output for automation
--output jsonl (or PSF_OUTPUT=jsonl) makes check, hunt, mitigate and rollback write JSON Lines for monitoring and language models. Each finding of check carries a kind (vulnerability, exposure or compromise), a stable code such as MAGENTO_UPLOAD_PHP and the install's path; a host with no install says so (applicable: false). psf-report turns the records into a summary, Markdown, HTML or PDF. PSF_READ_ONLY=1 refuses mitigate and rollback before they start, so a scheduled run can only read. The format and the reports: Output for automation.
The Security Patches software and this documentation are dedicated to the public domain under CC0 1.0 Universal. Other pages on privacysafe.app/docs are CC BY-SA 4.0 unless the page says otherwise.