# CVE-2022-39261: Twig may load a template outside a configured directory when using the filesystem loader

Source: https://junglewise.ai/threats/cve-2022-39261-drupal-core-2022-016-drupal-uses-the-twig-https-twig-symfony-com  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2022-09-30  
License: CC BY 4.0 with a link back

CVE-2022-39261 · Severity: low · CVSS 3.1 · Published 2022-09-30

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

Technologies: [drupal/core (Packagist)](https://junglewise.ai/threats/technologies/packagist-drupal-core), [twig/twig (Packagist)](https://junglewise.ai/threats/technologies/twig-twig). Vendors: [Packagist](https://junglewise.ai/threats/vendors/packagist).

## Quick answers

**Is CVE-2022-39261 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2022-39261 being exploited in the wild.

**How severe is CVE-2022-39261?** Low severity, with a CVSS score of 3.1, published 30 September 2022.

**Which products and versions are affected?** drupal/core (Packagist) ECOSYSTEM:introduced=8.0.0,fixed=9.3.22|ECOSYSTEM:introduced=9.4.0,fixed=9.4.7; twig/twig (Packagist) ECOSYSTEM:introduced=1.0.0,fixed=1.44.7.

**Is there a fix for CVE-2022-39261?** Yes. drupal/core (Packagist): upgrade to 9.3.22 or later; twig/twig (Packagist): upgrade to 1.44.7 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2022-39261?** Check whether you run drupal/core (Packagist) or twig/twig (Packagist) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- drupal/core (Packagist): upgrade to 9.3.22 or later

  ```sh
  composer require drupal/core:^9.3.22
  ```

- twig/twig (Packagist): upgrade to 1.44.7 or later

  ```sh
  composer require twig/twig:^1.44.7
  ```


## Affected products

- drupal/core (Packagist) ECOSYSTEM:introduced=8.0.0,fixed=9.3.22|ECOSYSTEM:introduced=9.4.0,fixed=9.4.7
- twig/twig (Packagist) ECOSYSTEM:introduced=1.0.0,fixed=1.44.7

## Identifiers

- CVE-2022-39261
- DRUPAL-CORE-2022-016
- GHSA-52m2-vc4m-jj33

## Related threats

- [Drupal core Link module cross-site scripting in markup sanitization](https://junglewise.ai/threats/cve-2026-108515-drupal-core-2026-015-the-drupal-core-link-module-provides-a)
- [Drupal Navigation module cross-site scripting in attributes](https://junglewise.ai/threats/cve-2026-108514-drupal-core-2026-016-the-navigation-module-doesn-t-sufficiently)
- [Drupal Core remote code execution in Field UI module](https://junglewise.ai/threats/cve-2026-108097-drupal-core-2026-014-a-remote-code-execution-vulnerability)
- [Drupal cross-site scripting in CKEditor WYSIWYG](https://junglewise.ai/threats/drupal-core-2026-013-the-drupal-project-uses-the-ckeditor-https-github-f5b3da40)
- [Drupal stored cross-site scripting in Layout Builder](https://junglewise.ai/threats/cve-2026-55805-drupal-stored-cross-site-scripting-in-layout-builder)
