CVE-2026-49981
published 2026-07-14CVE-2026-49981: Twig is a template language for PHP. Prior to 3.27.0, the per-template filter, tag, and function allow-list verdict is computed when a Template instance is…
PriorityP344high8.2CVSS 3.1
AVNACLPRNUINSUCHILAN
EPSS
0.36%
29.8th percentile
Twig is a template language for PHP. Prior to 3.27.0, the per-template filter, tag, and function allow-list verdict is computed when a Template instance is constructed and can remain cached after sandbox state changes between renders, allowing a later sandboxed render to reuse a template that was originally checked with a different or empty policy. This issue is fixed in version 3.27.0.
Affected
3 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| symfony | twig | < 3.27.0 | 3.27.0 |
| twig | twig | >= 0 < 3.27.0 | 3.27.0 |
| twigphp | twig | < 3.27.0 | 3.27.0 |
CVSS provenance
nvdv3.18.2HIGHCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N
nvdv4.06.0MEDIUMCVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
VulDB
twigphp Twig up to 3.26.x Sandbox sandbox
vuldb·2026-07-15·CVSS 6.0
CVE-2026-49981 [MEDIUM] twigphp Twig up to 3.26.x Sandbox sandbox
A vulnerability, which was classified as critical, has been found in twigphp Twig up to 3.26.x. This vulnerability affects unknown code of the component Sandbox. Performing a manipulation results in sandbox issue.
This vulnerability is reported as CVE-2026-49981. The attack is possible to be carried out remotely. No exploit exists.
GHSA
Twig: Sandbox filter, tag and function allow-list bypass when sandbox state changes between renders for a cached `Template`
ghsa·2026-07-01
CVE-2026-49981 [HIGH] CWE-693 Twig: Sandbox filter, tag and function allow-list bypass when sandbox state changes between renders for a cached `Template`
Twig: Sandbox filter, tag and function allow-list bypass when sandbox state changes between renders for a cached `Template`
### Description
The per-template filter, tag and function allow-list check is compiled into the `checkSecurity()` method of each `Template` subclass and was invoked once from the constructor, gated by `SandboxExtension::isSandboxed($source)`. `Template` instances are then cached on the `Environment` in `$loadedTemplates`, so the verdict computed at construction time was sticky for the rest of the process.
Any later change of sandbox state on the same `Environment` left that cached verdict in place: toggling `SandboxExtension::enableSandbox()`/`disableSandbox()`, swapping the policy via `setSecurityPolicy()`, a `SourcePolicyInterface` decision flip, or simply having
No detection rules found.
No public exploits indexed.
Bugzilla
CVE-2026-49981 phpMyAdmin: Twig: Information disclosure via sandbox bypass [epel-all]
bugzilla·2026-07-15·CVSS 6.0
CVE-2026-49981 [MEDIUM] CVE-2026-49981 phpMyAdmin: Twig: Information disclosure via sandbox bypass [epel-all]
CVE-2026-49981 phpMyAdmin: Twig: Information disclosure via sandbox bypass [epel-all]
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.
Twig is a template language for PHP. Prior to 3.27.0, the per-template filter, tag, and function allow-list verdict is computed when a Template instance is constructed and can remain cached after sandbox state changes between renders, allowing a later sandboxed render to reuse a template that was originally checked with a different or empty policy. This issue is fixed in version 3.27.0.
Bugzilla
CVE-2026-49981 phpMyAdmin: Twig: Information disclosure via sandbox bypass [fedora-all]
bugzilla·2026-07-15·CVSS 6.0
CVE-2026-49981 [MEDIUM] CVE-2026-49981 phpMyAdmin: Twig: Information disclosure via sandbox bypass [fedora-all]
CVE-2026-49981 phpMyAdmin: Twig: Information disclosure via sandbox bypass [fedora-all]
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.
Twig is a template language for PHP. Prior to 3.27.0, the per-template filter, tag, and function allow-list verdict is computed when a Template instance is constructed and can remain cached after sandbox state changes between renders, allowing a later sandboxed render to reuse a template that was originally checked with a different or empty policy. This issue is fixed in version 3.27.0.
Bugzilla
CVE-2026-49981 twig/twig: Twig: Information disclosure via sandbox bypass
bugzilla·2026-07-14·CVSS 6.0
CVE-2026-49981 [MEDIUM] CVE-2026-49981 twig/twig: Twig: Information disclosure via sandbox bypass
CVE-2026-49981 twig/twig: Twig: Information disclosure via sandbox bypass
Twig is a template language for PHP. Prior to 3.27.0, the per-template filter, tag, and function allow-list verdict is computed when a Template instance is constructed and can remain cached after sandbox state changes between renders, allowing a later sandboxed render to reuse a template that was originally checked with a different or empty policy. This issue is fixed in version 3.27.0.
2026-07-14
Published