CVE-2022-39261
Description
Twig is a template language for PHP. Versions 1.x prior to 1.44.7, 2.x prior to 2.15.3, and 3.x prior to 3.4.3 encounter an issue when the filesystem loader loads templates for which the name is a user input. It is possible to use the `source` or `include` statement to read arbitrary files from outside the templates' directory when using a namespace like `@somewhere/../some.file`. In such a case, validation is bypassed. Versions 1.44.7, 2.15.3, and 3.4.3 contain a fix for validation of such template names. There are no known workarounds aside from upgrading.
How to fix
- symfony twig1.44.7, 2.15.3, 3.4.3 or later
- drupal drupal9.3.22, 9.4.7 or later
- drupal/core9.3.22, 9.4.7 or later
- twig/twig1.44.7, 2.15.3, 3.4.3 or later
- debian.org/security/2022/dsa-5248
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AUVTXMNPSZAHS3DWZEM56V5W4NPVR6L7/
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2OKRUHPVLIQVFPPJ2UWC3WV3WQO763NR/
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YU4ZYX62H2NUAKKGUES4RZIM4KMTKZ7F/
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NWRFPZSR74SYVJKBTKTMYUK36IJ3SQJP/
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TW53TFJ6WWNXMUHOFACKATJTS7NIHVQE/
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WV5TNNJLGG536TJH6DLCIAAZZIPV2GUD/
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| symfony twig | 1.0.0 ≤ v < 1.44.7, 2.0.0 ≤ v < 2.15.3, 3.0.0 ≤ v < 3.4.3 | 1.44.7, 2.15.3, 3.4.3 |
| drupal drupal | 8.0.0 ≤ v < 9.3.22, 9.4.0 ≤ v < 9.4.7 | 9.3.22, 9.4.7 |
| fedoraproject fedora | 35, 36, 37 | — |
| debian debian_linux | 10.0, 11.0 | — |
| drupal/corePackagist | 8.0.0 ≤ v < 9.3.22, 9.4.0 ≤ v < 9.4.7 | 9.3.22, 9.4.7 |
| twig/twigPackagist | 1.0.0 ≤ v < 1.44.7, 2.0.0 ≤ v < 2.15.3, 3.0.0 ≤ v < 3.4.3 | 1.44.7, 2.15.3, 3.4.3 |
Check your version
Choose the product and enter the version you run to see whether it falls in the affected range.
Attack Surface Management
See the assets tied to your domains, the technologies they run and known vulnerabilities in one list.