Vulnerability CVE-2022-39261: Information

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.

Severity: HIGH (7.5) Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Published: Sept. 28, 2022
Modified: Nov. 7, 2023
Error type identifier: CWE-22

Fixed packages

References to Advisories, Solutions, and Tools

    1. Configuration 1

      cpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:*
      Start including
      3.0.0
      End excliding
      3.4.3

      cpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:*
      Start including
      2.0.0
      End excliding
      2.15.3

      cpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:*
      Start including
      1.0.0
      End excliding
      1.44.7

      Configuration 2

      cpe:2.3:a:drupal:drupal:*:*:*:*:*:*:*:*
      Start including
      9.4.0
      End excliding
      9.4.7

      cpe:2.3:a:drupal:drupal:*:*:*:*:*:*:*:*
      Start including
      8.0.0
      End excliding
      9.3.22

      Configuration 3

      cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*

      cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:*

      cpe:2.3:o:fedoraproject:fedora:37:*:*:*:*:*:*:*

      Configuration 4

      cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*

      cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*