Skip to main content
EPSS 0.6%top 54%

CVE-2026-46636: CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine in twigphp Twig

0
High
Published: 09/04/2026 (09/04/2026, 22:07:35 UTC)
Source: CVE Database V5
Vendor/Project: twigphp
Product: Twig

Description

Twig versions from 1.0.0 up to but not including 3.27.0 contain a vulnerability where the SecurityPolicy::checkMethodAllowed() function unconditionally allows all method calls on instances of Twig\Markup and its subclasses. This flaw allows sandboxed templates to access every public method of Markup-derived objects, bypassing configured method restrictions. The issue was fixed in version 3.27.0.

CVSS v4.0

Score 8.7high

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

Affected software

twigphp

Twig

Affected versions
>=1.0.0 <3.27.0

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 09/15/2026, 00:53:21 UTC

Technical Analysis

Twig, a PHP template engine, has a security vulnerability (CVE-2026-46636) in versions >=1.0.0 and <3.27.0 where SecurityPolicy::checkMethodAllowed() improperly whitelists all method calls on Twig\Markup instances. Since Twig\Markup is not a final class, subclasses inherit this bypass, enabling sandboxed templates to invoke any public method on Markup-derived objects regardless of the allowedMethods configuration. This improper neutralization of special elements used in the template engine could lead to unauthorized method execution within sandboxed templates. The vulnerability has been patched in version 3.27.0.

Potential Impact

An attacker with the ability to supply objects of Markup-derived classes into sandboxed templates can invoke any public method on those objects, bypassing method call restrictions. This can lead to unauthorized actions or information disclosure within the context of the template execution environment. The CVSS 4.0 score is 8.7 (high severity), indicating a significant impact with network attack vector, low attack complexity, no privileges or user interaction required, and high vulnerability and confidentiality impact.

Mitigation Recommendations

Upgrade Twig to version 3.27.0 or later, where this vulnerability has been fixed. No other mitigations are indicated or recommended by the vendor advisory. Patch status is confirmed by the vendor advisory stating the issue is resolved in 3.27.0.

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-05-15T20:11:54.584Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 6a9b44f4acd9273b4958ae50

Added to database: 09/04/2026, 22:23:48 UTC

Last enriched: 09/15/2026, 00:53:21 UTC

Last updated: 10/20/2026, 06:48:17 UTC

Views: 95

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