Drupal core - SA-CORE-2022-016
Drupal uses the Twig third-party library for content templating and sanitization. Twig has released a security update that affects Drupal. Twig has rated the vulnerability as high severity.
Drupal core's code extending Twig has also been updated to mitigate a related vulnerability.
Multiple vulnerabilities are possible if an untrusted user has access to write Twig code, including potential unauthorized read access to private files, the contents of other files on the server, or database credentials.
The vulnerability is mitigated by the fact that an exploit is only possible in Drupal core with a restricted access administrative permission. Additional exploit paths for the same vulnerability may exist with contributed or custom code that allows users to write Twig templates.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Composer package | drupal/core | >= 8.0.0, < 9.3.22, >= 9.4.0, < 9.4.7 | 9.3.22, 9.4.7 |
| Composer package | twig/twig | >= 1.0.0, < 1.44.7, >= 2.0.0, < 2.15.3, >= 3.0.0, < 3.4.3 | 1.44.7, 2.15.3, 3.4.3 |
| Drupal (core) | drupal/core | >= 8.0.0, < 9.3.22, >= 9.4.0, < 9.4.7 | 9.3.22, 9.4.7 |
References
- https://github.com/twigphp/Twig/security/advisories/GHSA-52m2-vc4m-jj33
- https://nvd.nist.gov/vuln/detail/CVE-2022-39261
- https://github.com/twigphp/Twig/commit/35f3035c5deb0041da7b84daf02dea074ddc7a0b
- https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2022-39261.yaml
- https://github.com/twigphp/Twig
- https://lists.debian.org/debian-lts-announce/2022/10/msg00016.html
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/2OKRUHPVLIQVFPPJ2UWC3WV3WQO763NR
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AUVTXMNPSZAHS3DWZEM56V5W4NPVR6L7
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NWRFPZSR74SYVJKBTKTMYUK36IJ3SQJP
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TW53TFJ6WWNXMUHOFACKATJTS7NIHVQE
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WV5TNNJLGG536TJH6DLCIAAZZIPV2GUD
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YU4ZYX62H2NUAKKGUES4RZIM4KMTKZ7F
- https://symfony.com/blog/twig-security-release-possibility-to-load-a-template-outside-a-configured-directory-when-using-the-filesystem-loader
- https://www.debian.org/security/2022/dsa-5248
- https://www.drupal.org/sa-core-2022-016
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N- Weakness (CWE)
CWE-22- Platform
- Composer, Drupal
- Package
drupal/core, twig/twig- Disclosed
- 28.09.2022
- Updated
- 11.10.2026 13:17
Sources and licenses
OSV / GitHub Advisory Database - GHSA-52m2-vc4m-jj33 - CC BY 4.0
OSV / GitHub Advisory Database - DRUPAL-CORE-2022-016 - CC BY-SA 2.0; code GPL-2.0-or-later
Vulnerability history: drupal/core
All published vulnerabilities of this package (Drupal (core)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 165
- First → latest
- 02.2018 09.2026
- Without a fix
- 3
- Exploited in attacks
- 5
Severity breakdown
- Critical 17
- High 44
- Medium 72
- Low 6
- Unrated 26
Disclosures per year
- 2018: 4
- 2019: 14
- 2020: 12
- 2021: 11
- 2022: 61
- 2023: 6
- 2024: 36
- 2025: 8
- 2026: 13
-
Drupal core - SA-CORE-2022-016 this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.