Home / Advisories / CVE-2026-49981 CVE-2026-49981: Twig: Sandbox filter, tag and function allow-list bypass when sandbox state changes between renders for a cached `Template` high Affects twig/twig . Feed 2026.11.23.2, updated 2026-11-23; published 2026-07-01 ; advisory modified 2026-09-10 .
Twig: Sandbox filter, tag and function allow-list bypass when sandbox state changes between renders for a cached `Template` Package twig/twig Composer Affected versions <3.27.0Fixed in 3.27.0Severity high Exploitation not on CISA KEV Published 2026-07-01 Source osv.dev References Quick answers Is CVE-2026-49981 being actively exploited?
It is not on CISA's Known Exploited Vulnerabilities list today.
Which version fixes CVE-2026-49981?
twig/twig: 3.27.0.
How do I check whether I am affected?
Run `phpwarden deps composer.lock`. phpwarden checks the exact version you have installed against this advisory.
Am I affected? Find out in one command. phpwarden checks your composer.lock against this advisory and 21,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.lockOr keep it checked automatically: GitHub Action · pre-commit hook · GitLab CI · Laravel artisan command
Install docs How findings are ranked Related advisories CVE-2022-23614 high Code injection in Twig same package: twig/twig CVE-2015-7809 high Twig remote code execution in templates same package: twig/twig CVE-2022-39261 high Twig may load a template outside a configured directory when using the filesystem loader same package: twig/twig CVE-2019-9942 low Twig Sandbox Information Disclosure same package: twig/twig CVE-2024-45411 high Twig has a possible sandbox bypass same package: twig/twig CVE-2026-46633 critical Twig: PHP code injection via `{% use %}` template name same package: twig/twig