CVE-2026-71291: Bolt CMS Server-Side Template Injection via Unsandboxed allow_twig Field Rendering
Bolt CMS renders content field values through Twig's full application-level Environment with no SandboxExtension registered anywhere in the codebase. In src/Entity/Field.php, getTwigValue() calls shouldBeRenderedAsTwig(), which gates rendering only on the field definition's allowtwig flag and a regex checking for {{, {%, or {#; when true, the raw field value is compiled and rendered via self::getTwig()->createTemplate($value)->render(['record' => $this->getContent()]) with no sandboxing. Bolt's own bundled config/bolt/contenttypes.yaml sets allowtwig: true on the default "pages" contenttype's content field out of the box. Any user with edit access to that content type (a standard editor role, not just an administrator) can inject a Twig payload such as {{ ['id']|map('passthru')|join }} that executes arbitrary OS commands when the content is saved and rendered, achieving remote code execution as the web server user.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
In src/bolt/contenttypes.yaml, set allow_twig: false for the default "pages" content type so Twig field rendering is disabled (prevents Twig payload execution on save/render).
Bolt CMS content type (contenttypes.yaml) - pages allow_twig = false - Compensating control
Restrict edit access for the affected Bolt CMS content type(s) so that only trusted admins (not standard editor roles) can create/modify fields that support allow_twig rendering, reducing the chance of Twig payload injection.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-71291?
CVE-2026-71291 has a severity rating of high, with a score of 8.8.
What are the potential impacts of CVE-2026-71291?
CVE-2026-71291 could lead to critical security issues such as remote code execution due to server-side template injection.
How do I fix CVE-2026-71291?
To fix CVE-2026-71291, update to the latest version of Bolt CMS that mitigates this vulnerability.
Who is affected by CVE-2026-71291?
CVE-2026-71291 affects all users of Bolt CMS versions that allow the use of the allow_twig field without proper sandboxing.
What action should I take if I suspect exploitation of CVE-2026-71291?
If you suspect exploitation of CVE-2026-71291, immediately apply security patches, review logs for unauthorized access, and monitor system behavior.