Incorrect Authorization Affecting twig/twig package, versions <3.27.0


Severity

Recommended
0.0
low
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.27% (19th 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-17111491
  • published31 May 2026
  • disclosed27 May 2026
  • creditEl Kharoubi Iosif

Introduced: 27 May 2026

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

How to fix?

Upgrade twig/twig to version 3.27.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 the deprecated twig_array_some(), twig_array_every(), and twig_check_arrow_in_sandbox() helper functions. An attacker can bypass the sandbox callback restrictions by supplying non-Closure callables to twig_array_some() or twig_array_every(), as these wrappers fail to propagate the sandbox state and invoke CoreExtension::arraySome() / arrayEvery() with sandbox enforcement disabled.

Note: Compiled Twig templates are not affected. This issue is only exploitable if an application directly uses the deprecated twig_* helper functions with a sandboxed Environment.

CVSS Base Scores

version 4.0
version 3.1