All reports
High

Code injection in Twig

Affected versions

Version ranges need review.

Composertwig/twig
Affected versions
>=2.0.0,<2.14.11|>=3.0.0,<3.3.8
Fixed version
Not reported
Composertwig/twig
Affected versions
>= 2.0.0, < 2.14.11
Fixed version
2.14.11
Composertwig/twig
Affected versions
>= 3.0.0, < 3.3.8
Fixed version
3.3.8

Exploitation

CVE-2022-23614

Probability of exploitation in the next 30 days: 8.21%

FIRST EPSS · 2026-11-19

Description

Description

When in a sandbox mode, the arrow parameter of the sort filter must be a closure to avoid attackers being able to run arbitrary PHP functions.

Resolution

We now disallow calling non Closure in the sort filter like we already did for some other filters.

Credits

We would like to thank Marlon Starkloff for reporting the issue and Fabien Potencier for fixing the issue.

Links