Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1336 CNY

100%

CVE-2026-46636— Twig: Sandbox method allowlist bypass via `Markup` subclass

Quick assessment

Affected
twigphp Twig
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

以下是这段漏洞描述的中文翻译: Twig 是一种用于 PHP 的模板语言。在 1.0.0 至 3.27.0 之前的版本中, 无条件地将 实例上的所有方法调用加入白名单。由于 不是 final 类,其子类也会继承这一绕过机制。当应用程序将一个派生自 的对象传入沙盒化模板(通常是为了标记一段 HTML 为安全内容)时,该子类的每一个公共方法都会对模板作者开放,无论配置的 列表如何设置。该问题已在 3.27.0 版本中修复。

CVSS 8.7 · High
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2026-46636

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
Twig: Sandbox method allowlist bypass via `Markup` subclass
Source: CVE Program / CVE List V5
Vulnerability Description
Twig is a template language for PHP. From version 1.0.0 to before version 3.27.0, SecurityPolicy::checkMethodAllowed() unconditionally whitelists all method calls on instances of Twig\Markup. Twig\Markup is not final, so subclasses inherit the bypass. An application that passes an object of a Markup-derived class into a sandboxed template (typically to mark a chunk of HTML as safe) inadvertently exposes every public method of that subclass to template authors, regardless of the configured allowedMethods list. This issue has been patched in version 3.27.0.
Source: CVE Program / CVE List V5
CVSS Information
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
Source: CVE Program / CVE List V5
Vulnerability Type
CWE-1336
Source: CVE Program / CVE List V5

Affected Products

Vendor Product Affected Versions CPE Subscribe
twigphp Twig >= 1.0.0, < 3.27.0 -

II. Public POCs for CVE-2026-46636

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2026-46636

登录查看更多情报信息。

Vendor Advisories for CVE-2026-46636 (3)

Security Blog Posts for CVE-2026-46636 (1)

Vendor Pages for CVE-2026-46636 (1)

IV. Related Vulnerabilities

V. Comments for CVE-2026-46636

No comments yet


Leave a comment