The vulnerability is a remote code execution flaw within Statamic's Antlers templating engine. The root cause is the lack of separation between parsing trusted developer-created templates and untrusted user-provided content. An authenticated user with permissions to edit content in fields where Antlers parsing is enabled could inject malicious template code.
The analysis of the security patches reveals several key vulnerable components:
-
Statamic\View\Antlers\Antlers::parse: This was the primary insecure function. It processed template strings without any sandboxing, treating all input as trusted. The patches refactor this to operate in a "trusted" or "untrusted" mode, with untrusted being the default to prevent accidental misuse.
-
Method and Tag Execution: The functions Statamic\View\Antlers\Language\Runtime\Sandbox\Environment::process, ModifierManager::guardRuntimeModifier, and NodeProcessor::guardRuntimeTag were responsible for executing methods, modifiers, and tags within a template. They did not check if the template being processed was from an untrusted source, allowing an attacker to call arbitrary PHP methods and use dangerous tags/modifiers.
-
Information Disclosure: The Statamic\View\Cascade::contextualVariables function exposed all application configuration variables (including secrets like database passwords and API keys) to the template context. An attacker could simply use a template variable like {{ config:database.connections.mysql.password }} to read and exfiltrate this sensitive data.
The patches address these issues by introducing a sandboxing mechanism. When parsing user content (isEvaluatingUserData is true), the engine now operates with a strict allow-list of safe tags and modifiers, disables arbitrary method calls, and provides only a minimal, safe subset of configuration variables.