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

high Affects twig/twig, drupal/core. Feed 2026.10.29.3, updated 2026-10-29; published ; advisory modified .

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

Package
twig/twig Composer
Affected versions
>=1.0.0 and <1.44.7 or >=2.0.0 and <2.15.3 or >=3.0.0 and <3.4.3
Fixed in
1.44.7, 2.15.3, 3.4.3
Severity
high  CVSS 7.5
Exploitation
not on CISA KEV · EPSS 3% (88.0th percentile)
Published
2022-09-30
Source
osv.dev

References

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

Package
drupal/core Composer
Affected versions
>= 8.0.0 <9.3.22 or >= 9.4.0 <9.4.7
Fixed in
9.3.22, 9.4.7
Severity
unknown
Exploitation
not on CISA KEV · EPSS 3% (88.0th percentile)
Published
2022-09-28
Source
osv.dev

References

CWE-22
NVD recordtwig/twig advisoriesdrupal/core advisories

Am I affected?

Find out in one command. phpwarden checks your composer.lock against this advisory and 20,000+ others, ranked by real-world exploitation (CISA KEV + EPSS). Free, offline, open data.

# PHP projects (recommended)
composer require --dev phpwarden/phpwarden
# then
vendor/bin/phpwarden deps composer.lock

# or, without Composer
pipx install phpwarden   &&   phpwarden deps composer.lock

Or keep it checked automatically: GitHub Action · pre-commit hook · GitLab CI · Laravel artisan command

Install docs   How findings are ranked

Related advisories