ADVISORIES

Vulnerability

CVE-2022-39261

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.

7 advisories report this vulnerability, across 3 ecosystems.

High severity All Debian 3Packagist 2Ubuntu 2

Advisories

  • DEBIAN-CVE-2022-39261

    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…

    CVE-2022-39261 Debian Updated 20 November 2026
  • DLA-3147-1

    twig - security update

    CVE-2022-39261 Debian Updated 20 November 2026
  • DRUPAL-CORE-2022-016

    Drupal uses the [Twig](https://twig.symfony.com/) third-party library for content templating and sanitization. [Twig has released a security…

    CVE-2022-39261 Packagist Updated 19 September 2026
  • DSA-5248-1

    php-twig - security update

    CVE-2022-39261 Debian Updated 20 November 2026
  • GHSA-52m2-vc4m-jj33

    Twig may load a template outside a configured directory when using the filesystem loader

    High CVE-2022-39261 Packagist Updated 10 December 2025
  • UBUNTU-CVE-2022-39261

    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…

    CVE-2022-39261 Ubuntu Updated 4 February 2026
  • USN-5947-1

    php-twig, twig vulnerabilities

    CVE-2019-9942CVE-2022-23614CVE-2022-39261 Ubuntu Updated 25 June 2026

References