Skip to content
CVE Tracker
  • Newest CVEsPage
  • Recently added to KEVPage
  • Rising exploitation (EPSS)Page
  • Weekly digestPage
  • StatisticsPage
  • WatchlistPage
  • API documentationPage
  • MCP serverPage
  • Data sourcesPage
  • ChangelogPage
  • AboutPage
  • How it's builtPage
Back

CVE-2022-39261

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

High7.5EPSS 3.2%
Published
Updated
Reserved
Assigned by
GitHub_M

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.

Scores

CVSS scores of CVE-2022-39261, by who scored it
Scored byCVSSScoreVector
GitHub_MCNA (assigner)3.1High7.5CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
NVDNVD · Modified3.1High7.5CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
EPSS (exploitation in 30 days)
3.2% · top 12% of all CVEs (5 Nov 2026)
CISA SSVC
Exploitation: none · Automatable: yes · Technical impact: partial
Loading the EPSS history…

The list uses the assigner's score when there is one, then CISA's, then NVD's: High 7.5.

Weakness

Affected products

  • twigphp · Twig

    • affected => 1.0.0, < 1.44.7
    • affected >= 2.0.0, < 2.15.3
    • affected >= 3.0.0, < 3.4.3

Affected packages

From reviewed advisories of the GitHub Advisory Database.

References (11)

Sources

The same CVE in the primary databases and aggregators, to check against.

Badge for a README or a ticket

CVE-2022-39261 badge
[![CVE-2022-39261](https://trackcve.app/badge/CVE-2022-39261.svg)](https://trackcve.app/cve/CVE-2022-39261)

Record last updated .