Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-49981: CWE-693: Protection Mechanism Failure in twigphp Twig

0
Medium
VulnerabilityCVE-2026-49981cvecve-2026-49981cwe-693cwe-863
Published: 07/14/2026 (07/14/2026, 21:26:00 UTC)
Source: CVE Database V5
Vendor/Project: twigphp
Product: Twig

Description

Twig, a PHP template language, has a protection mechanism failure vulnerability prior to version 3.27.0. The issue involves the caching of per-template allow-list verdicts for filters, tags, and functions, which can persist after sandbox state changes between renders. This allows a sandboxed render to reuse a template that was originally checked with a different or empty policy. The vulnerability is fixed in version 3.27.0.

CVSS v4.0

Score 6.0medium

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
Low
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
Low
Vuln. Availability
None
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N

Affected software

Packagistmore threats →ai
twig/twig
pkg:composer/twig/twig
Affected versions
<3.27.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/14/2026, 22:09:12 UTC

Technical Analysis

CVE-2026-49981 describes a protection mechanism failure in twigphp's Twig template engine. Before version 3.27.0, the allow-list verdict for filters, tags, and functions is computed when a Template instance is constructed and cached. If the sandbox state changes between renders, this cached verdict may be reused incorrectly, allowing a sandboxed render to execute with an outdated or inappropriate policy. This issue was addressed and fixed in Twig version 3.27.0.

Potential Impact

The vulnerability allows a sandboxed render to reuse a template checked under a different or empty policy, potentially bypassing sandbox restrictions. This could lead to unauthorized execution of template code that should have been restricted. The CVSS 4.0 score is 6.0 (medium severity), indicating a moderate impact with network attack vector, low attack complexity, and partial privileges required.

Mitigation Recommendations

Upgrade Twig to version 3.27.0 or later, where this issue is fixed. No other mitigation is indicated or required according to the available data.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-06-02T18:30:51.282Z
Cvss Version
4.0
State
PUBLISHED
Remediation Level
null

Threat ID: 6a56aea568715ace4342b6f0

Added to database: 07/14/2026, 21:48:21 UTC

Last enriched: 07/14/2026, 22:09:12 UTC

Last updated: 07/14/2026, 22:09:12 UTC

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses