
针对 CVE-2026-72781 的 Python 概念验证,该漏洞是 Craft CMS Twig 沙箱逃逸,通过串联 AttributeTypecastBehavior gadget 实现经过身份验证的远程代码执行。
Craft 的沙箱类允许列表允许在 Element 对象上调用从 yii\base\Component 继承的方法。一个受沙箱限制的对象模板可以附加 AttributeTypecastBehavior、注册其回调,并触发命令执行。
该组件 gadget 已在本地以 www-data 身份在 Craft 的生产环境 renderSandboxedObjectTemplate() 下得到确认。Python PoC 通过已认证的元素搜索对象模板 sink 投递相同的 gadget,并且需要 --execute。该路径为盲注;仅凭 HTTP 200 不能作为证据。
python3 -m pip install -r requirements.txt
python3 poc.py https://target.example editor id --execute
仅限授权安全测试使用。