CVE-2022-23614 Code injection in Twig
Attackers can execute arbitrary PHP code via the sort filter in Twig sandbox mode due to improper closure validation.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-23614?
CVE-2022-23614 is a high-severity code injection vulnerability in Debian Debian Linux, published on 4 Feb 2022. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
Twig is an open source template language for PHP. 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. In affected versions this constraint was not properly enforced and could lead to code injection of arbitrary PHP code. Patched versions now disallow calling non Closure in the `sort` filter as is the case for some other filters. Users are advised to upgrade.
Which versions are affected by CVE-2022-23614?
4 open source packages ship an affected version, including twig/twig. It affects 3 products.
| Package | Affected | Fixed in |
|---|---|---|
twig/twig Packagist | From 2.0.0 | 2.14.11 |
twig/twig Packagist | From 2.0.0 | 2.14.11 |
twig/twig Packagist | From 3.0.0 | 3.3.8 |
twig/twig Packagist | From 3.0.0 | 3.3.8 |
Products include Debian Debian Linux, Fedoraproject Fedora, Symfony Twig.
How do I fix CVE-2022-23614?
Upgrade twig/twig to a fixed version for your release line: 2.14.11 or 3.3.8.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2022-23614 being exploited?
There is no known exploitation of CVE-2022-23614 in the wild and no public exploit code.
Public exploit code: 2 proofs of concept on GitHub.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as DEBIAN-CVE-2022-23614, DSA-5107-1, GHSA-5mv2-rx3q-4w2v, UBUNTU-CVE-2022-23614.