PatchSiren

PatchSiren cyber security CVE debrief

CVE-2026-133764 Twig CVE debrief

A sandbox bypass vulnerability exists in Twig, a PHP templating engine, when using custom tests that convert input to strings. This could allow a user with limited privileges to execute code outside the sandbox. The vulnerability is caused by insufficient checks on custom test inputs in Twig's sandbox. Applications are affected when they register such a test and allow it in the sandbox. No built-in test is affected. The sandbox now checks the input of tests like the input of filters. The built-in tests that never convert their input to a string still skip the check.

Vendor
Twig
Product
twig/twig
CVSS
LOW 2.3
CISA KEV
Not listed in stored evidence
Original CVE published
2026-11-24
Original CVE updated
2026-11-24
Advisory published
2026-11-24
Advisory updated
2026-11-24

Who should care

Defenders of applications using Twig, especially those using custom tests, should assess exposure and prioritize updating to version 3.31.1 or higher. Verification of exposure and updating to version 3.31.1 or higher are crucial. Defenders should care about this vulnerability as it could allow code execution outside the sandbox in Twig, especially in applications using custom tests.

Why it matters

Defenders should care about this vulnerability as it could allow code execution outside the sandbox in Twig, especially in applications using custom tests. Verification of exposure and updating to version 3.31.1 or higher are crucial.

  • Potential code execution outside the sandbox
  • Increased risk for users with limited privileges
  • Need for verification of custom test usage
  • Priority on updating to version 3.31.1 or higher

Technical summary

The vulnerability exists due to insufficient checks on custom test inputs in Twig's sandbox. This could allow a user to execute code outside the sandbox. The vulnerability allows code execution outside the sandbox in Twig, especially in applications using custom tests. The sandbox now checks the input of tests like the input of filters. The built-in tests that never convert their input to a string still skip the check. Affected applications should assess exposure and prioritize updating to version 3.31.1 or higher.

Defensive priority

Defenders should prioritize verifying if their applications use custom tests that could be exploited and updating to version 3.31.1 or higher of Twig.

Recommended defensive actions

  • Verify if applications use custom tests that could be exploited
  • Update to version 3.31.1 or higher of Twig
  • Review and restrict usage of custom tests in Twig
  • Confirm whether affected product deployments exist in managed environments and assign an owner for follow-up.
  • Review compensating controls for exposed systems while remediation is scheduled and verified.
  • Check relevant monitoring, detection, and logs for exposed assets that need extra review.
  • Track exceptions, retest remediated assets, and close the item only after evidence is documented.

Evidence notes

The CVE record and source item provide details on the vulnerability, including its existence in versions prior to 3.31.1 of Twig and the fix in version 3.31.1. The vulnerability allows code execution outside the sandbox in Twig, especially in applications using custom tests. Verification of exposure and updating to version 3.31.1 or higher are crucial.

Sources and references

Verified primary and authoritative sources

  • CVE-2026-133764 CVE Program record

    Publisher, destination, and source semantics verified

    URL: https://www.cve.org/CVERecord?id=CVE-2026-133764

    CVE Program - Official CVE Program record with source-provided CVE metadata.

  • CVE-2026-133764 NVD vulnerability detail

    Publisher, destination, and source semantics verified

    URL: https://nvd.nist.gov/vuln/detail/CVE-2026-133764

    NIST National Vulnerability Database - Official NIST NVD detail page and source-specific vulnerability assessment.

Supplemental references

  • Sandbox `__toString()` policy bypass via the input of custom tests

    Unverified legacy reference

    URL: https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2026/133xxx/CVE-2026-133764.json

    cve_program_cvelist_v5

  • Source reference

    Unverified legacy reference

    URL: https://symfony.com/cve-2026-133764

    Supplemental source - vendor-advisory

  • Source reference

    Unverified legacy reference

    URL: https://github.com/twigphp/Twig/security/advisories/GHSA-rc9g-xwx4-rmfh

    Supplemental source - vendor-advisory

  • Source reference

    Unverified legacy reference

    URL: https://github.com/twigphp/Twig/commit/978c60be74fc62a0f2c3af11ca5bc3609ae8b69a

    Supplemental source - patch

Methodology and review provenance

AI-assisted synthesis based on stored public vulnerability evidence. System validation, approval state, and publication status do not by themselves establish human review of this revision. PatchSiren helps prioritize defensive review and does not prove exposure or remediation on any system.