---
id: "CVE-2026-112771"
kind: "vulnerability"
aliases: ["CVE-2026-112771"]
title: "Craft CMS: Twig sandbox bypass leaks security key and database credentials"
severity: "high"
cvss: 7.1
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["craft-cms", "package", "php", "self-hosted"]
not_affected_if: ["no-control-panel-users", "patched-version"]
published_at: "2026-10-19T20:17:54+00:00"
first_seen_at: "2026-10-23T21:57:19+00:00"
updated_at: "2026-10-25T03:34:51+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-112771", "first_seen_at": "2026-10-23T21:57:19+00:00"}]
---

# Craft CMS: Twig sandbox bypass leaks security key and database credentials

Craft CMS filters in the Twig template sandbox resolve caller-supplied dot-path keys without checking the sandbox policy, so they can reach the craft global. An authenticated Control Panel user can read the securityKey, database credentials and auth tokens.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed Craft version in `composer.lock` or by running `php craft version`; affected versions are 4.0.0 to before 4.18.8 and 5.0.0 to before 5.11.0
- Confirm which users have Control Panel access and whether untrusted users can edit Twig templates

## Fix

- Upgrade Craft CMS 4.x to `4.18.8` or later
- Upgrade Craft CMS 5.x to `5.11.0` or later
- After upgrading, rotate the securityKey, database credentials and auth tokens if an untrusted user had Control Panel access

## Timeline

- 2026-10-23T21:57:19+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-112771

## From the sources

Craft CMS 4.0.0 before 4.18.8 and 5.0.0 before 5.11.0 contains a Twig sandbox allowlist bypass because the column, contains, filterByValue, index, where, and multisort filters resolve caller-supplied keys via ArrayHelper::getValue() without consulting the sandbox security policy. Authenticated Control Panel users can supply dot-path keys to traverse the craft global and disclose the securityKey, database credentials, and auth tokens.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
