BlockStrap (CVE-2026-103849, CVSS 10.0) gets past the StyleSmuggler fix through the same template engine. Adobe fixed it in the October isolated patch, APSB26-153. You need both: VULN-39341 first, then the October patch (how). Sansec had seen no BlockStrap attacks on live stores as of their 15th October write-up, and reproduced four exploit routes within 24 hours of the patch.
Apply Adobe’s patch (how). It supersedes the containment patch on this page; revert that first, never run both. Composer patches for 2.4.4 to 2.4.9, older patch levels included. A patch does not clean an infected node. The checks and recovery steps below still apply.
Last updated: 2nd November 2026. Added BlockStrap (CVE-2026-103849), which VULN-39341 does not fix, and Sansec’s indicators for the tooling found on a store compromised on 9th September.
StyleSmuggler Zero-Day (CVE-2026-75650)
StyleSmuggler (CVE-2026-75650), tracked by Adobe as VULN-39341 and patched in bulletin APSB26-146, is an actively exploited, unauthenticated RCE affecting fully patched Magento Open Source and Adobe Commerce stores. The attack writes PHP into a Magento report or log file, then causes Magento to include it.
Start with the incident response overview. This page is an on-call runbook: checks, containment, recovery. The vulnerability analysis, implant internals and live indicators are Sansec’s, and their advisory is the source and the only thing updated in real time.
Check for compromise
Three builds so far, all the same implant renaming itself.
| Original | fc-cache (06/09) | chronyd (07/09) | |
|---|---|---|---|
| Process | [kworker/u:8:0] | fc-cache | chronyd |
| Drop path | ~/.local/share/.gvfsd/gvfsd-user | ~/.cache/fontconfig/fc-cache | /tmp/.chrony-<8hex>/chronyd |
| Lock | ~/.local/share/.gvfsd/.gvfsd_<8hex>.lock | /tmp/.fc_<8hex>.lock | none documented |
| Cron | */5 * * * * | 13,43 * * * * | 57,27 * * * * on one host, none on another (self-relaunching) |
| Version | not published | 2.1.4 | 2.1.5 |
The chronyd build can run with no cron entry at all: on one host it relaunched itself, with parent PID 1. On another it wrote 57,27 * * * * straight into the cron spool. Sansec attribute it to the same implant renaming rather than a fresh infection, because the 8-hex agent ID carried over from the earlier drop. Cron-based checks alone can miss an infected host. The name is also chosen to defeat the obvious hunt: anyone filtering UDP/123 traffic will have whitelisted chronyd as the legitimate NTP daemon.
Sansec’s beacon fingerprint separates it from a real NTP client: nine 48-byte datagrams roughly 10 ms apart every 60 seconds, where a real client sends one, and every datagram marked NTPv4 server mode.
The commands below cover all three, and the IOC list has the paths and C2 hosts for each.
Run as the Magento filesystem user, then repeat the process and socket checks as root.
crontab -l | grep -iE 'gvfsd|fontconfig|fc-cache|chrony'
grep -rlE 'gvfsd|fc-cache|chronyd' /var/spool/cron/ 2>/dev/null
ls -la ~/.local/share/.gvfsd/ ~/.cache/fontconfig/fc-cache \
/tmp/.kw_* /tmp/.cache_* /tmp/.gvfsd[-_]* /tmp/.fc[-_]* /tmp/fc-cache \
/tmp/.chrony-*/chronyd 2>/dev/null
ps -eo user,pid,ppid,comm,args | awk '$1 != "root" && ($4 ~ /kworker|fc-cache|chronyd|kstrp|ksmd/ || ($3 == 1 && $4 ~ /sshd|bash/))'
# free signal where the web user cannot write cron — the implant retries every minute
grep -r 'crontab command not allowed' /var/log/
# second, unrelated actor: PHP under pub/media, where there should be none
find -L pub/media -type f -name '*.php'
~ must resolve to the PHP-FPM user’s home. The implant writes directly to the cron spool and uses both hyphenated and underscored paths. Remove its cron persistence before killing the process or it will recreate itself. A non-root kworker process is suspicious. fc-cache and chronyd are both names of real system binaries, so confirm with readlink /proc/<pid>/exe before acting on either; collect evidence before attaching a debugger, as the implant checks whether it is traced.
Where the web user cannot write a crontab the implant still tries once a minute, and every attempt is logged. Sansec report a merchant with www-data in /etc/cron.deny whose auth log carried thousands of these. The first line dated the infection more than a day before the process was noticed:
crontab[<pid>]: (www-data) AUTH (crontab command not allowed)
A store compromised on 9th September had different tooling again, documented by Sansec: gs-netcat dropped as pub/defunct, the WraithC2 RAT running as sshd: apache@notty, -bash and [kworker/u16:2] (all with parent PID 1), a cookie-triggered remote include edited into vendor/magento/framework/App/View.php, and a base64 skimmer in design/head/includes on every store view. Wraith kept its binaries in PHP-FPM’s systemd private /tmp, which is not the /tmp a shell sees.
ls -la pub/defunct defunct defunct.dat 2>/dev/null
grep -c gl_google_advisor vendor/magento/framework/App/View.php # anything but 0 is the backdoor
ls -la /tmp/systemd-private-*-php-fpm.service-*/tmp/ # as root: PHP-FPM's private /tmp
grep -aFc 'Laminas\Loader\Exception\InvalidArgumentException' var/log/exception.log # one per stage-2 attempt
Then, against the store database:
SELECT scope, scope_id, value FROM core_config_data WHERE path = 'design/head/includes';
Look for a base64 blob or a POST to any of the skimmer hosts in the IOC list. exception.log outlives access-log rotation, so it is the best record of attempts; halve the count where Magento_Support is enabled, as it logs every exception twice.
For each suspicious PID:
readlink -v /proc/<pid>/exe
readlink -v /proc/<pid>/cwd
sha256sum /proc/<pid>/exe
lsof -nP -a -p <pid>
ss -plantu
A failed exploit attempt immediately followed by a successful one, seconds apart from the same source, is a pattern worth alerting on: it is the operator falling back to a second write sink.
Search reports and logs from the Magento root:
grep -Ral --fixed-strings '<?' var/report/ var/log/
grep -Ral -e 'X_TRACE_' -e 'X-TRACE-' -e 'x_trace_' var/report/ var/log/
grep -Fal 'array_merge()' var/log/system.log
The array_merge() error indicates Magento included a poisoned file. Disrex found successful infections using var/log/system.log, so search both var/report and var/log.
Run eComscan against the entire account. The implant lives above the document root.
~/bin/ecomscan \
--skip-dashboard \
--format=json \
--min-confidence=0 \
--deep \
/path/to/account/root
The scope argument matters. Disrex had a store return a clean result while its cron persistence was actively re-adding itself, because the scan was pointed at the document root. Capture volatile evidence first. Sansec note that eComscan 1.9.7 may terminate the malicious process for Shield customers.
No matches or a clean scan do not prove the host is clean. Resolve scan errors before continuing.
Drain the node and restrict outbound traffic first. Preserve /proc/<pid>/exe, process metadata, sockets, cron and relevant logs. Do not reboot or run composer install: both can destroy useful evidence.
Contain StyleSmuggler
1. Update Sansec Shield
Sansec Shield has a live virtual patch. Update it, then hunt every node for compromises that pre-date the rules.
2. Block GraphQL if you don’t use it
If you do not use GraphQL, block the complete route at every public ingress. Cover plain and index.php URLs, store prefixes and direct origin access. Stores using GraphQL must rely on Shield and application containment.
3. Apply Adobe’s patch (VULN-39341)
Adobe shipped VULN-39341 (CVE-2026-75650) on 7th September 2026 as APSB26-146, with composer patches for 2.4.4 to 2.4.9, older patch levels included. Adobe’s announcement and download links map each version to its patch file. There is no Adobe patch for 2.2, 2.3 or 2.4.0 to 2.4.3; Scandiweb backported the fix to 41 of those versions, which Sansec have not reviewed. Adobe’s September isolated patch (APSB26-138) does not include this fix, so apply both. Adobe also says to rotate the encryption key and every credential it protects, at the source rather than only inside Magento. This is the fix to run. Everything below it is superseded and kept only for stores mid-rollout.
# revert any interim containment patch FIRST — it touches the same files
patch -p1 -R < stylesmuggler-containment.patch
patch -p1 --forward < VULN-39341_<your-version>.patch
bin/magento setup:di:compile # BlockFactory gains a constructor argument
systemctl reload php8.5-fpm
One path stays open, unchanged by VULN-39341 (I have not re-tested it against the October patch): {{block class=X}} autoloads X before the
type check rejects it, so a .php file written into generated/code or app/code still
executes through the directive. It needs a separate file-write bug to reach.
Graycore’s patch closes it
with a {{block}} allowlist.
Then apply the October patch for BlockStrap. BlockStrap (CVE-2026-103849, CVSS 10.0, found by vozec) is a second-pass directive injection in the same template engine. VULN-39341 signs trusted directives, but attacker data in a child template can still be signed and rescanned at the root level, where a smuggled {{block}} directive runs. Adobe fixed it on 13th October 2026 in APSB26-153, the October isolated patch, by replacing the rescan with registered placeholders. Sansec’s write-up has the detail.
- The October patch does not contain VULN-39341, and Adobe’s registry does not list it as a prerequisite. Apply VULN-39341 first.
- Isolated patches apply in release order: July, August, September, then October. The security patches page has the full list.
- Public Open Source downloads cover 2.4.7-p10, 2.4.8-p5 and 2.4.9 (ka-49323). 2.4.4-p18, 2.4.5-p17 and 2.4.6-p15 need an Adobe Commerce licence; Happy Horizon published backports, with no warranty.
- On 2.4.8-p5, also apply
248p5-2026-10-002-CE. A copy of the October file downloaded on 13th October lacks a change for CVE-2026-91013, which Adobe published separately. - Mage-OS is affected up to 3.5.0. Mage-OS 3.6.0 contains the fix.
Check both landed. Composer patch plugins and patch ... || true can skip a hunk without failing the deploy:
grep -c resolveDeferredDirectives vendor/magento/framework/Filter/Template.php # 0 = BlockStrap fix missing
vendor/bin/magento-patches -n status | grep "39341\|Status" # StyleSmuggler hotfix
On Mage-OS, check vendor/mage-os/framework/Filter/Template.php instead. The October patch also leaves an empty file named 976bc24c08055e67a58cf491401c8b2f3d48ff55b8092f1ede196bac4756a228 in the Magento root. It is a lock-file bug (magento/magento2#41535), not an IOC.
4. Interim containment patch (superseded)
Kept for stores mid-rollout. Revert it once Adobe’s patch is on.
These changes block both known include sinks. They do not correct Magento’s template system, rule out alternative gadgets, or clean an infected host.
Treat the write side as uncontainable: any file-write bug substitutes for the log poisoning, and moving sessions to Redis or the database is not a mitigation. Sansec record an attempt against session storage failing and the same operator succeeding eight seconds later through a file uploaded via Magento’s custom options, which Magento’s own cron then removes, so its absence proves nothing. Twelve of twelve tested combinations (var/log, var/report, pub/media/*.php, pub/media/*.jpg, /tmp, app/code against both sinks) execute unpatched and are blocked by revision 2, so the gadget guards are the load-bearing half and the serializer and logger hunks are defence in depth. More on the testing.
One residual path stays open: {{block class=X}} with scalar parameters still autoloads X, and generated/code and app/code are autoload roots, so a .php file written into either executes through the directive, patched or not. Log poisoning and pub/media cannot reach it. Graycore’s patch (now archived) closes it with a {{block}} allowlist permitting nothing by default.
This is unofficial emergency containment, written for a live zero-day before Adobe’s fix existed. It is provided as is, with no warranty, and it will change as new variants and evidence surface. The gadget list is not closed and the observed request shapes have already mutated once. Test it on a staging environment against your own extension set before production, keep an eye on this page and Sansec’s advisory, and replace all of it with Adobe’s fix.
Revert revision 1 before applying revision 2. Never run both.
Revision 1 closed the one disclosed include sink. Revision 2 targets the cause both stages share (a caller-supplied class reaching a constructor before its type is checked) and keeps the sink hardening as well, so poisoned reports and logs stay inert either way.
Save the revision you deploy as stylesmuggler-containment.patch.
diff --git a/vendor/magento/framework/View/Element/BlockFactory.php b/vendor/magento/framework/View/Element/BlockFactory.php
--- a/vendor/magento/framework/View/Element/BlockFactory.php
+++ b/vendor/magento/framework/View/Element/BlockFactory.php
@@ -41,6 +41,18 @@
public function createBlock($blockName, array $arguments = [])
{
$blockName = ltrim($blockName, '\\');
+ // Validate the resolved type before instantiating: the stock order runs an
+ // arbitrary caller-supplied constructor before the type check rejects it.
+ if (!is_string($blockName) || $blockName === '') {
+ throw new \LogicException('Block name must be a non-empty string');
+ }
+ $omConfig = \Magento\Framework\App\ObjectManager::getInstance()
+ ->get(\Magento\Framework\ObjectManager\ConfigInterface::class);
+ $instanceType = $omConfig->getInstanceType($omConfig->getPreference($blockName));
+ if (!is_subclass_of($instanceType, BlockInterface::class)) {
+ throw new \LogicException($blockName . ' does not implement BlockInterface');
+ }
+
$block = $this->objectManager->create($blockName, $arguments);
if (!$block instanceof BlockInterface) {
throw new \LogicException($blockName . ' does not implement BlockInterface');
diff --git a/vendor/magento/module-backend/Model/Widget/Grid/Row/UrlGeneratorFactory.php b/vendor/magento/module-backend/Model/Widget/Grid/Row/UrlGeneratorFactory.php
--- a/vendor/magento/module-backend/Model/Widget/Grid/Row/UrlGeneratorFactory.php
+++ b/vendor/magento/module-backend/Model/Widget/Grid/Row/UrlGeneratorFactory.php
@@ -36,6 +36,18 @@
*/
public function createUrlGenerator($generatorClassName, array $arguments = [])
{
+ if (!is_string($generatorClassName) || $generatorClassName === '') {
+ throw new \InvalidArgumentException('Passed wrong parameters');
+ }
+ // Validate the resolved type before instantiating; the post-construction
+ // check below is kept so both invariants hold.
+ $omConfig = \Magento\Framework\App\ObjectManager::getInstance()
+ ->get(\Magento\Framework\ObjectManager\ConfigInterface::class);
+ $instanceType = $omConfig->getInstanceType($omConfig->getPreference($generatorClassName));
+ if (!is_subclass_of($instanceType, \Magento\Backend\Model\Widget\Grid\Row\GeneratorInterface::class)) {
+ throw new \InvalidArgumentException('Passed wrong parameters');
+ }
+
$rowUrlGenerator = $this->_objectManager->create($generatorClassName, $arguments);
if (false === $rowUrlGenerator instanceof \Magento\Backend\Model\Widget\Grid\Row\GeneratorInterface) {
throw new \InvalidArgumentException('Passed wrong parameters');
diff --git a/vendor/magento/module-email/Model/Template/Filter.php b/vendor/magento/module-email/Model/Template/Filter.php
--- a/vendor/magento/module-email/Model/Template/Filter.php
+++ b/vendor/magento/module-email/Model/Template/Filter.php
@@ -408,6 +408,14 @@
{
$skipParams = ['class', 'id', 'output'];
$blockParameters = $this->getParameters($construction[2]);
+
+ // Authored {{block}} params are always scalar; a non-scalar only arrives
+ // through $var substitution, which is how attacker constructor data gets in.
+ foreach ($blockParameters as $blockParameterValue) {
+ if ($blockParameterValue !== null && !is_scalar($blockParameterValue)) {
+ return '';
+ }
+ }
$block = null;
diff --git a/vendor/magento/framework/Logger/Handler/Base.php b/vendor/magento/framework/Logger/Handler/Base.php
--- a/vendor/magento/framework/Logger/Handler/Base.php
+++ b/vendor/magento/framework/Logger/Handler/Base.php
@@ -95,6 +95,16 @@
$this->filesystem->createDirectory($logDir);
}
+ // StyleSmuggler containment: neutralise PHP open tags so a poisoned log
+ // file is inert whichever include gadget reaches it.
+ if (isset($record['formatted']) && is_string($record['formatted'])) {
+ $record['formatted'] = str_replace(
+ ['<?', '<%'],
+ ['<?', '<%'],
+ $record['formatted']
+ );
+ }
+
parent::write($record);
}
diff --git a/vendor/magento/framework/Webapi/ErrorProcessor.php b/vendor/magento/framework/Webapi/ErrorProcessor.php
--- a/vendor/magento/framework/Webapi/ErrorProcessor.php
+++ b/vendor/magento/framework/Webapi/ErrorProcessor.php
@@ -17,6 +17,7 @@
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Phrase;
use Magento\Framework\Serialize\Serializer\Json;
+use Magento\Framework\Serialize\Serializer\JsonHexTag;
use Magento\Framework\Webapi\Exception as WebapiException;
/**
@@ -96,7 +97,7 @@
$this->_logger = $logger;
$this->_filesystem = $filesystem;
$this->directoryWrite = $this->_filesystem->getDirectoryWrite(DirectoryList::VAR_DIR);
- $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
+ $this->serializer = $serializer ?: ObjectManager::getInstance()->get(JsonHexTag::class);
$this->registerShutdownFunction();
}
diff --git a/pub/errors/processor.php b/pub/errors/processor.php
--- a/pub/errors/processor.php
+++ b/pub/errors/processor.php
@@ -8,7 +8,7 @@
namespace Magento\Framework\Error;
use Magento\Config\Model\Config\Reader\Source\Deployed\DocumentRoot;
-use Magento\Framework\Serialize\Serializer\Json;
+use Magento\Framework\Serialize\Serializer\JsonHexTag;
use Magento\Framework\Escaper;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\App\Response\Http;
@@ -156,7 +156,7 @@
/**
* JSON serializer
*
- * @var Json
+ * @var JsonHexTag
*/
private $serializer;
@@ -172,7 +172,7 @@
/**
* @param Http $response
- * @param Json $serializer
+ * @param JsonHexTag $serializer
* @param Escaper $escaper
* @param DocumentRoot|null $documentRoot
*/
@@ -185,7 +185,7 @@
$this->_response = $response;
$this->_errorDir = __DIR__ . '/';
$this->_reportDir = dirname(dirname($this->_errorDir)) . '/var/report/';
- $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
+ $this->serializer = $serializer ?: ObjectManager::getInstance()->get(JsonHexTag::class);
$this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class);
$this->documentRoot = $documentRoot ?? ObjectManager::getInstance()->get(DocumentRoot::class);
if (!empty($_SERVER['SCRIPT_NAME'])) {Six changes.
BlockFactory::createBlock(): resolve preferences and virtual types, checkBlockInterfacebefore instantiating. Stock order instantiates first, so the constructor has already run by the time the check fails.UrlGeneratorFactory::createUrlGenerator(): same bug, same fix.Filter::blockDirective(): reject non-scalar{{block}}parameters. Removes the primitive rather than one gadget.- Report serializers:
JsonHexTagon both writers, so newvar/reportfiles carry no raw PHP tags. Logger\Handler\Base::write(): escape PHP open tags, so a poisonedvar/logfile is inert.
The last two are defence in depth, not the fix.
The stage-two gadget reached in my testing is with_resolved at
vendor/aws/aws-sdk-php/src/AwsClient.php:282, shipped with every Magento install. It is
one of many: guarding the factories rather than enumerating gadgets is the point.
Dropped from revision 1: Io::includeFile(), the three DI scanner guards and
PaymentFailuresService::handle().
diff --git a/pub/errors/processor.php b/pub/errors/processor.php
--- a/pub/errors/processor.php
+++ b/pub/errors/processor.php
@@ -8,7 +8,7 @@
namespace Magento\Framework\Error;
use Magento\Config\Model\Config\Reader\Source\Deployed\DocumentRoot;
-use Magento\Framework\Serialize\Serializer\Json;
+use Magento\Framework\Serialize\Serializer\JsonHexTag;
use Magento\Framework\Escaper;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\App\Response\Http;
@@ -156,7 +156,7 @@
/**
* JSON serializer
*
- * @var Json
+ * @var JsonHexTag
*/
private $serializer;
@@ -172,7 +172,7 @@
/**
* @param Http $response
- * @param Json $serializer
+ * @param JsonHexTag $serializer
* @param Escaper $escaper
* @param DocumentRoot|null $documentRoot
*/
@@ -185,7 +185,7 @@
$this->_response = $response;
$this->_errorDir = __DIR__ . '/';
$this->_reportDir = dirname(dirname($this->_errorDir)) . '/var/report/';
- $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
+ $this->serializer = $serializer ?: ObjectManager::getInstance()->get(JsonHexTag::class);
$this->escaper = $escaper ?: ObjectManager::getInstance()->get(Escaper::class);
$this->documentRoot = $documentRoot ?? ObjectManager::getInstance()->get(DocumentRoot::class);
if (!empty($_SERVER['SCRIPT_NAME'])) {
diff --git a/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php b/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php
--- a/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php
+++ b/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php
@@ -132,6 +132,11 @@
private function includeClass(string $className, string $fileItemPath): bool
{
if (!class_exists($className)) {
+ // phpcs:ignore Magento2.Security.Superglobal
+ if (PHP_SAPI !== 'cli' || isset($_SERVER['REQUEST_METHOD'])) {
+ throw new \RuntimeException('Class files can only be scanned from a command-line process.');
+ }
+
// phpcs:ignore
require_once $fileItemPath;
return true;
diff --git a/setup/src/Magento/Setup/Module/Di/Code/Scanner/ArrayScanner.php b/setup/src/Magento/Setup/Module/Di/Code/Scanner/ArrayScanner.php
--- a/setup/src/Magento/Setup/Module/Di/Code/Scanner/ArrayScanner.php
+++ b/setup/src/Magento/Setup/Module/Di/Code/Scanner/ArrayScanner.php
@@ -15,6 +15,11 @@
*/
public function collectEntities(array $files)
{
+ // phpcs:ignore Magento2.Security.Superglobal
+ if (PHP_SAPI !== 'cli' || isset($_SERVER['REQUEST_METHOD'])) {
+ throw new \RuntimeException('DI array files can only be scanned from a command-line process.');
+ }
+
$output = [];
foreach ($files as $file) {
if (file_exists($file)) {
diff --git a/setup/src/Magento/Setup/Module/Di/Code/Scanner/XmlInterceptorScanner.php b/setup/src/Magento/Setup/Module/Di/Code/Scanner/XmlInterceptorScanner.php
--- a/setup/src/Magento/Setup/Module/Di/Code/Scanner/XmlInterceptorScanner.php
+++ b/setup/src/Magento/Setup/Module/Di/Code/Scanner/XmlInterceptorScanner.php
@@ -99,6 +99,13 @@
$className = preg_replace('/^([0-9A-Za-z]*)_([0-9A-Za-z]*)/', '\\1_\\2_controllers', $className);
$filePath = stream_resolve_include_path(str_replace('_', '/', $className) . '.php');
if (file_exists($filePath)) {
+ // phpcs:ignore Magento2.Security.Superglobal
+ if (PHP_SAPI !== 'cli' || isset($_SERVER['REQUEST_METHOD'])) {
+ throw new \RuntimeException(
+ 'Controller class files can only be scanned from a command-line process.'
+ );
+ }
+
require_once $filePath;
}
}
diff --git a/vendor/magento/framework/Code/Generator/Io.php b/vendor/magento/framework/Code/Generator/Io.php
--- a/vendor/magento/framework/Code/Generator/Io.php
+++ b/vendor/magento/framework/Code/Generator/Io.php
@@ -157,7 +157,23 @@
*/
public function includeFile($fileName)
{
- return include $fileName;
+ $generationDirectory = $this->filesystemDriver->getRealPath($this->_generationDirectory);
+ $realFileName = $this->filesystemDriver->getRealPath($fileName);
+ $generationDirectory = $generationDirectory
+ ? rtrim(str_replace('\\', '/', $generationDirectory), '/') . '/'
+ : false;
+ $realFileName = $realFileName ? str_replace('\\', '/', $realFileName) : false;
+
+ if (!$generationDirectory || !$realFileName || strpos($realFileName, $generationDirectory) !== 0) {
+ throw new FileSystemException(
+ new \Magento\Framework\Phrase(
+ 'The generated code file "%1" is outside the generation directory.',
+ [$fileName]
+ )
+ );
+ }
+
+ return include $realFileName;
}
/**
diff --git a/vendor/magento/framework/Logger/Handler/Base.php b/vendor/magento/framework/Logger/Handler/Base.php
--- a/vendor/magento/framework/Logger/Handler/Base.php
+++ b/vendor/magento/framework/Logger/Handler/Base.php
@@ -95,6 +95,17 @@
$this->filesystem->createDirectory($logDir);
}
+ // Temporary StyleSmuggler containment: neutralise PHP open tags on the
+ // fully formatted line, so a poisoned log file is inert whichever include
+ // gadget reaches it. Revert once Adobe ships a supported fix.
+ if (isset($record['formatted']) && is_string($record['formatted'])) {
+ $record['formatted'] = str_replace(
+ ['<?', '<%'],
+ ['<?', '<%'],
+ $record['formatted']
+ );
+ }
+
parent::write($record);
}
diff --git a/vendor/magento/framework/Webapi/ErrorProcessor.php b/vendor/magento/framework/Webapi/ErrorProcessor.php
--- a/vendor/magento/framework/Webapi/ErrorProcessor.php
+++ b/vendor/magento/framework/Webapi/ErrorProcessor.php
@@ -17,6 +17,7 @@
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Phrase;
use Magento\Framework\Serialize\Serializer\Json;
+use Magento\Framework\Serialize\Serializer\JsonHexTag;
use Magento\Framework\Webapi\Exception as WebapiException;
/**
@@ -96,7 +97,7 @@
$this->_logger = $logger;
$this->_filesystem = $filesystem;
$this->directoryWrite = $this->_filesystem->getDirectoryWrite(DirectoryList::VAR_DIR);
- $this->serializer = $serializer ?: ObjectManager::getInstance()->get(Json::class);
+ $this->serializer = $serializer ?: ObjectManager::getInstance()->get(JsonHexTag::class);
$this->registerShutdownFunction();
}
diff --git a/vendor/magento/module-sales/Model/Service/PaymentFailuresService.php b/vendor/magento/module-sales/Model/Service/PaymentFailuresService.php
--- a/vendor/magento/module-sales/Model/Service/PaymentFailuresService.php
+++ b/vendor/magento/module-sales/Model/Service/PaymentFailuresService.php
@@ -98,6 +98,12 @@
string $message,
string $checkoutType = 'onepage'
): PaymentFailuresInterface {
+ // Temporary StyleSmuggler containment.
+ $this->logger->warning('Payment failure email suppressed by temporary StyleSmuggler containment.');
+
+ return $this;
+
+ // phpcs:disable
$this->inlineTranslation->suspend();
$quote = $this->cartRepository->get($cartId);Eight changes.
- Report serializers use
JsonHexTag, preventing newvar/reportandvar/report/apifiles from containing raw PHP tags. The Web API change adapts Graycore’s mitigation. Io::includeFile()rejects files outside the generated-code directory.- DI scanners refuse to include PHP during web requests. CLI deployment commands still work.
PaymentFailuresService::handle()returns before rendering. Failed-payment emails remain disabled until the patch is removed.Logger\Handler\Base::write()escapes PHP open tags on the formatted line, so a poisonedvar/logfile is inert whichever include gadget reaches it. Coverssystem.log,debug.log,exception.logandcron.login one place.
Superseded by revision 2, which closes the factories rather than one sink. Kept here for
anyone still running it, and because its Io.php, ClassesScanner.php, ArrayScanner.php
and XmlInterceptorScanner.php hunks layer on top of revision 2 as defence in depth.
PaymentFailuresService is not worth keeping: it disables failed-payment emails and the
email path is a detection signal, not the execution route.
Applied to a clean Magento 2.4.7-p10 install and regression-tested.
Stage one, proven both ways. The log-poisoning primitive reproduces on an unpatched
2.4.7-p10 in a single unauthenticated request, and the patch stops it. Raw <?php
reaching var/log went from present to zero across four poisoning routes: the GraphQL
Store header, ___store on a REST route, /paypal/transparent/response/, and a
PHP-tagged User-Agent to /customer/section/load/. No raw <? in var/report either.
Stage two was not reproduced here, so these guards were reasoned rather than proven. Superseded: see revision 2, which does reproduce and block it.
Still works after patching: setup:di:compile from a wiped generated/, storefront,
category, cart, login, admin, GraphQL with a valid store, REST, cron:run, and a full
cache:flush and reindex. All eight modified files lint clean. Anchors verified against
release source for 2.4.6 through 2.4.9, and the logger hunk against both Monolog
generations Magento uses.
Paths in both revisions are Composer-layout, relative to the project root. For a core-layout checkout, rebase vendor/magento/framework to lib/internal/Magento/Framework, and vendor/magento/module-email, module-backend and module-sales to app/code/Magento/Email, app/code/Magento/Backend and app/code/Magento/Sales.
No constructor signatures change, so compiled DI stays valid: apply and clear opcache. No recompile, no static content deploy, no maintenance window. Push it with your normal tooling. Patching at scale covers Ansible and meta packages.
patch -p1 --forward --dry-run < stylesmuggler-containment.patch
patch -p1 --forward < stylesmuggler-containment.patch
systemctl reload php8.5-fpm # or: cachetool opcache:reset
--forward matters: without it, running the apply command twice on an already-patched
tree makes patch silently answer its own “Reversed (or previously applied) patch
detected! Assume -R?” prompt and remove the patch.
Rollback, same:
patch -p1 -R < stylesmuggler-containment.patch
systemctl reload php8.5-fpm
5. Quarantine files created before the patch
The patch does not change existing reports or protect var/log. Preserve suspicious files and move them outside every path available to the web runtime.
6. Server-level hardening
Consider disabling PHP’s proc_open and mounting /tmp, /var/tmp and /dev/shm with noexec. Test first: some deployment tools and extensions shell out. If your release process allows it, exclude the complete setup/ tree from web-runtime images.
Deploy and verify
Revert revision 2 before applying VULN-39341, then apply the October patch. Compile DI because Adobe adds a constructor
argument to BlockFactory, then clear opcache and return nodes one at a time. Verify:
- if blocked, GraphQL unreachable on every public hostname, and the origin blocked or authenticated
- new
var/reportandvar/report/apifiles start with<?php exit; ?>, and nested values contain no executable PHP opening tag - admin grids that use
rowUrlgenerators still render rows (Sales, Customers, Attribute Sets, Email Templates, Newsletter Queue, Integrations) - a
{{for}}loop in a custom email template still renders - the reproduced stage-two request cannot execute a file from
var/log,var/report,pub/media,/tmporapp/code - transactional email rendering still works, including failed-payment mail, and
{{block}}directives in CMS blocks, CMS pages and email templates still render. Never having seen a failed-payment email means nothing, as the code runs while the email is rendered and succeeds even when delivery fails grep -c resolveDeferredDirectives vendor/magento/framework/Filter/Template.phpis not 0 on any node- no suspicious process, persistence file or report marker on any node
Patched stores still send “Payment Transaction Failed” emails: an unauthenticated request to the PayPal GraphQL resolver fires one with no payment behind it. A burst after patching is not proof of compromise on its own. Tu Van’s plugin stops them.
If the containment patch is still installed, remove it before applying Adobe’s patch:
patch -p1 -R < stylesmuggler-containment.patch
systemctl reload php8.5-fpm
If a node is compromised
Assume the attacker read app/etc/env.php, the encryption key and every credential available to PHP-FPM. Do not disinfect in place.
- Preserve memory, disk and central logs.
- Rebuild from a known-good source revision and base image.
- Apply the mitigations above before accepting traffic.
- Rotate every secret readable by the compromised Unix account.
- Invalidate admin and customer sessions.
- Audit admin users, integrations, OAuth tokens, CMS content, email templates, database triggers, cron, queues and SSH keys.
- Hunt across every node, environment and shared home directory.
Checking the fleet at scale
Add the checks above to your healthcheck playbook and run them as the Magento filesystem user on every node. Treat scan errors as failures and roll out in waves so a hit can be investigated immediately. There is a ready-made Ansible task in the incident response post.
Current IOCs
Last reviewed 02/11/2026, against Sansec’s advisory as they last updated it on 14th September 2026. Infrastructure rotates, so re-check it before every hunt. Sansec publish no IOCs for BlockStrap, as no attacks have been seen.
From Sansec’s StyleSmuggler research:
https://www.incofar.it/js/jquery/plugins/ajaxfileupload/mag.txt # malware download
247.cdnflare.xyz # malware download
209.141.43.95 # malware download, http://209.141.43.95/files/ (FranTech AS53667)
99.84.67.186:443 # C2, WebSocket over TLS
windwsecurity.run:443 # TCP, remote shell
ntp.timesysnc.net:123 # UDP, NTP-shaped C2 traffic
time.microsft.run:123 # UDP, NTP-shaped C2 traffic
pool.microsft.studio:123 # UDP, NTP-shaped C2 traffic
ntp.timesync.to:123 # UDP, NTP-shaped C2 traffic, fc-cache build
ntp.synctime.to:123 # UDP, fallback
ntp.syncstime.to:123 # UDP, fallback
api4.ipify.org # plain-HTTP public IP lookup before beaconing
ipv4.icanhazip.com # plain-HTTP public IP lookup before beaconing
ipv4.ident.me # plain-HTTP public IP lookup before beaconing
ipinfo.io # plain-HTTP public IP lookup before beaconing
88.216.72.181 # attacker source, seen at multiple victims
182.182.152.48 # attacker source
209.73.130.148 # attacker source, successful exploit
76.31.99.207 # attacker source, failed exploit
77.239.124.107 # attacker source, follow-up requests
88.216.72.182 # attacker source
98.224.189.28 # attacker source
checkout-cdn.com # exfiltration
5.181.86.133 # historic — no longer listed by Sansec, unconfirmed
185.157.160.251:123 # C2, A record for ntp.timesync.to and ntp.timesysnc.net (07/09)
sha256 e315687a1dfe61ef4a5a5642214db6d3b2b05d81391285eebc2af664641a26a7
sha256 4352cabaa451e5a894535fbcc4d46628701303322a13745cb5479d7d0534ae8e # kworker-linux-x64, new build
sha256 d2fbf9eb75c495bfea48790d3b228fab0c15a282419c3d3f5e49294c4e1a3e82 # kworker-linux-arm64, new build
sha256 1a3374ffac5b0a62467612f264c49792d206304d4514409c982325c91231375d # chronyd build, from /proc/<pid>/exe
/tmp/.kw_<random><random>
/tmp/.cache_<random><random> # drop-path variant
/tmp/.fc-<8hex>/fc-cache
/tmp/fc-cache # drop-path variant
/tmp/.fc_<8hex>.lock # holds the implant PID
~/.local/share/.gvfsd/gvfsd-user
~/.local/share/.gvfsd/.gvfsd_<8hex>.lock
~/.cache/fontconfig/fc-cache
process [kworker/u:8:0]
process fc-cache
process chronyd # 07/09 build; parent PID 1 where it has no cron
/tmp/.chrony-<8hex>/chronyd
implant version 2.1.5 # beacon field; 2.1.4 in the 06/09 build
crontab */5 * * * * exec <home>/.local/share/.gvfsd/gvfsd-user
crontab 13,43 * * * * <home>/.cache/fontconfig/fc-cache >/dev/null 2>&1
crontab 57,27 * * * * /tmp/.chrony-<8hex>/chronyd >/dev/null 2>&1 # often written straight to the spool
User-Agent: python-requests 2.15.0 # implant operator's exploit requests
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
# implant only, for its plain-HTTP IP lookups
A second, unrelated attacker has been seen at the same victims, arriving through the same poisoning vector and dropping a PHP web shell that runs whatever arrives in a task POST parameter. Different operator, same way in:
sha256 d61217ca0bca83204302fa7b41935ce36f73764559c156d5c980f2fedddffb6e # 485-byte dropper
pub/media/catalog/product/cache/ss_<10hex>/sync_<10hex>.php # web shell
X-Cache-Token: fced27f6d57702565353ecc11722533b # required; 404 without it
457cfa2fb7p5.daf892t5qau4og8pi4cghbc6fhm1dim3u.oast.site # exec callback
ss5_457cfa2fb7 # marker echoed outside the PHP tags
The store compromised on 9th September adds a second toolkit, a framework backdoor and a skimmer, plus the sources Sansec logged for each stage of the exploit:
# gs-netcat (Global Socket Toolkit)
sha256 d94f75a70b5cabaf786ac57177ed841732e62bdcc9a29e06e5b41d9be567bcfa
212.132.98.170:443 # Global Socket relay
152.53.173.29:443 # Global Socket relay
pub/defunct # dropped, run, unlinked 26 seconds later
defunct # same binary, store root
defunct.dat # relay secret
GS_ARGS=-s <secret> -liD # process environment
process [kstrp]
process [ksmd] # also a real kernel thread; suspicious when not root
# WraithC2 RAT
sha256 64bcb4426783e2b4f8ec68b2f63e42cf4b404af6cd65c4c47f5ae3ac0a3d439e
BuildID b183335f5474b15df95c48ca781e75c27e704ac2
213.111.146.27:80,443,8443 # C2, beacon path /a9f3k2-c2
@wraith-8e32b7a8 # abstract unix socket shared by all three processes
process sshd: apache@notty # parent PID 1
process -bash # parent PID 1
process [kworker/u16:2] # parent PID 1
# in /tmp/systemd-private-<machine-id>-php-fpm.service-<8char>/tmp/
.dbus-session-48 # wraith binary
.dbus/dbus-session-48 # wraith binary
.pipewire-session-48 # wraith binary
.pipewire/pipewire-session-48 # wraith binary
.dbus/.c2 # wraith config
.dbus_<8hex>.lock # holds the live PID
.gsusr-48/defunct # gs-netcat copy
tmp.log # Adminer, fetched by the View.php include
adminer.version
# framework backdoor and skimmer
vendor/magento/framework/App/View.php # remote include
gl_google_advisor_824808 # cookie that triggers it, base64 URL
sha256 8cef8dcac2bb4598fb821859deb61c9b6889b4bdad00498a38d113954334bbb3 # Adminer 6.0.2
core_config_data design/head/includes # base64 skimmer, every store view
safeprocessor.com # skimmer POST target
assetsbundle.com # skimmer POST target
widgetassets.com # skimmer POST target
gtmtimestamp.com # skimmer POST target
specterguardian.com # skimmer POST target
# stage-1 sources
45.10.167.153
45.135.3.216
217.181.79.178
217.181.79.189
# stage-2 sources
45.135.2.183
216.40.73.46
146.19.140.158
45.145.128.160
194.26.129.230
88.218.44.215
83.142.54.144
93.177.119.38
37.72.141.145
144.31.2.154 # later attempts
217.181.64.0/18 # ten addresses in this range
# var/log/exception.log
Laminas\Loader\Exception\InvalidArgumentException # one per stage-2 attempt
Map file provided does not exist # failed include; absent on a day with the others is the bad case
Variable "$guard" of required type "Boolean!" was not provided. # attacker tooling
Requested store is not found (<? # PHP arriving in the Store header
Disrex recovered two more, from disk and from the running process on the same host:
sha256 8334b434fa3fe9f59cebe9609b11e0b1fd19d10212c45c705adec1902a1d06ef # on disk
sha256 251fabd50d7b18a8b5e1b3ef5d64e7198c17244778f6461fb1ab07f6169bf220 # in memory
Hash from a sample recovered during my own investigation, since adopted into Sansec’s published list:
sha256 b79dfdc1eed860e0b76c629d6adfce251db379b0b45a6d728d4ef483f7551420
Four hashes for one implant, two from the same machine. Hash matching is a bonus, not a detection strategy.
Do not rely on hashes or a single source IP. Look for the combination of process identity, executable path, persistence, outbound traffic, poisoned reports and the original web requests.
Sansec also lists requests involving /paypal/transparent/response/, /customer/section/load/ and /graphql with suspicious payloads. Correlate these with report/log content and process activity; the routes alone are legitimate traffic. Include UDP/123 and plain HTTP in outbound hunting, not only HTTPS. Recheck the live advisory as indicators change.
References
- Adobe: APSB26-146 security bulletin
- NVD: CVE-2026-75650
- Adobe: APSB26-153 security bulletin
- NVD: CVE-2026-103849
- Adobe: APSB26-153 patch downloads (ka-49323)
- Sansec: BlockStrap, Magento and Adobe Commerce RCE
- Graycore: Damien Retzinger’s analysis of CVE-2026-75650
- Scandiweb: StyleSmuggler fix for Magento 2.2 to 2.4.3
- Happy Horizon: APSB26-153 backports
- Adobe: APSB26-146 announcement and patch downloads
- Sansec: StyleSmuggler research
- Graycore: neutralise PHP open tags in Web API fatal reports
- Disrex: StyleSmuggler mitigation and live-incident findings
- Sansec: eComscan usage
- Adobe Commerce production filesystem permissions