Skip to content

Twig

Twig: `template_from_string()` escapes a SourcePolicy-driven sandbox via synthesized template name

CVE-2026-46634Published 14 Jul 2026, 21:19 UTC

Real-world risk

2.3/ 10Low

Routine

If the vulnerable configuration applies to you: 5.1

PreliminaryFrom the CVSS vector only · confidence low

CVSS

7.7

scored by the vendor (CNA), CVSS 4.0

In plain words

No plain-language summary yet. The original description is below.

Original description (from GitHub_M)

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 issue is fixed in version 3.26.0.

Am I affected?

ProductAffected versions (from the sources)Fixed in
TwigNiche>= 3.9.0, < 3.26.03.26.0

What to do

Update to a fixed version: 3.26.0.

Why this score

FactorValueEvidence×
ImpactFull compromiseCode execution or full control of the system or applicationFrom the CVSS vector1.00
Attacker positionInternetAnyone on the Internet can reach a typical deploymentFrom the CVSS vector1.00
Privileges neededLowA real low-privileged accountFrom the CVSS vector0.60
Victim interactionNoneNothingFrom the CVSS vector1.00
ConfigurationUncommonNeeds a non-default feature that a minority enablesFrom the CVSS vector0.45
ReliabilityReliableDeterministic: injection, logic bug, path traversalFrom the CVSS vector1.00

Threat level T1: Nothing known (× 0.85)

The default for a new disclosure

EPSS 0.5% chance of exploitation in 30 days (percentile 45), as of 2026-12-03.

The arithmetic
  1. Prerequisites multiplied together0.270
  2. Threat T1: Nothing known0.850
  3. 10 × impact 1 × prerequisites 0.27 × threat 0.852.295
  4. Rounded to one decimal between 0.1 and 102.3

How the score works

Exploitation and evidence timeline

  1. 14 Jul 2026 Published
  2. 3 Dec 2026 Risk 2.3 (cvss fallback)

Weakness

CWE-693

References

Get alerts for Twig

Free email or text alerts when a vulnerability in Twig reaches risk 8 or higher. Nothing else.