Incorrect Authorization Affecting twig/twig package, versions >=3.9.0, <3.26.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.42% (35th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Incorrect Authorization vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PHP-TWIGTWIG-16776519
  • published20 May 2026
  • disclosed20 May 2026
  • creditClaude Mythos

Introduced: 20 May 2026

CVE-2026-46634  (opens in a new tab)
CWE-863  (opens in a new tab)

How to fix?

Upgrade twig/twig to version 3.26.0 or higher.

Overview

twig/twig is a flexible, fast, and secure template language for PHP.

Affected versions of this package are vulnerable to Incorrect Authorization via Environment::createTemplate() when sandboxing is enabled selectively through SourcePolicyInterface. An attacker can bypass Twig sandbox restrictions by rendering attacker-controlled inner templates through template_from_string and include, as synthesized template names are not recognized by name/path-based source policies, causing checkSecurity() enforcement to be skipped and allowing access to unrestricted tags, filters, and functions.

CVSS Base Scores

version 4.0
version 3.1