Impact
Twig is a template language for PHP. From 3.9.0 until 3.26.0, template_from_string() compiles an inner template under a synthesized __string_template__<hash> name that can fall outside a SourcePolicyInterface sandbox decision, allowing a sandboxed template that can call template_from_string and include to render an inner template without security policy enforcement. This bypasses the sandbox restrictions, and the issue is fixed by upgrading to version 3.26.0. The weakness is classified as CWE‑693.
Affected Systems
The vendor/product is Twig from twigphp. Affected versions are all releases from 3.9.0 up through 3.26.0, inclusive. These versions expose the sandbox escape via template_from_string.
Risk and Exploitability
The CVSS score is 7.7, indicating a high severity. The EPSS score is less than 1 %, suggesting a low likelihood of exploitation in the near term. The vulnerability is not listed in CISA’s KEV catalog. Based on the description, the likely attack vector requires the ability to supply or influence the template content, after which the attacker can trigger template_from_string to render an inner template outside the defined policy.
OpenCVE Enrichment
Debian DSA
Github GHSA