
Python proof-of-concept for CVE-2026-72781, a Craft CMS Twig sandbox escape that chains an AttributeTypecastBehavior gadget to achieve authenticated remote code execution.
Craft's sandbox class allowlisting permits methods inherited from yii\base\Component
on Element objects. A sandboxed object template can attach an
AttributeTypecastBehavior, register its callback, and trigger command execution.
The component gadget was confirmed locally under Craft's production
renderSandboxedObjectTemplate() as www-data. The Python PoC delivers the same gadget
through the authenticated element-search object-template sink and requires --execute.
The path is blind; HTTP 200 alone is not proof.
python3 -m pip install -r requirements.txt
python3 poc.py https://target.example editor id --execute
For authorized security testing only.