{
  "affected": [
    {
      "ranges": [
        {
          "database_specific": {
            "extracted_events": [
              {
                "range": [
                  {
                    "fixed": "97b2e40b1165e6a42a197843f96ccb0a55f46f34"
                  }
                ],
                "source": "REFERENCES_COMMIT"
              }
            ]
          },
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "97b2e40b1165e6a42a197843f96ccb0a55f46f34"
            }
          ],
          "repo": "https://github.com/twigphp/twig",
          "type": "GIT"
        }
      ]
    }
  ],
  "aliases": [
    "GHSA-r34x-hh9h-9q9c"
  ],
  "database_specific": {
    "cna_assigner": "Symfony",
    "cwe_ids": [
      "CWE-79",
      "CWE-863"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/133xxx/CVE-2026-133770.json",
    "unresolved_ranges": [
      {
        "extracted_events": [
          {
            "range": [
              {
                "fixed": "3.31.1"
              }
            ],
            "source": "AFFECTED_FIELD",
            "strategy": "StandardRange"
          }
        ]
      }
    ]
  },
  "details": "The sandbox allows every method of Twig\\Markup objects, including their public constructor. A sandboxed template can therefore call __construct() on any Markup object that it reaches, and replace its content:\n\n{% do banner.__construct('\u003cscript\u003ealert(1)\u003c/script\u003e', 'UTF-8') %}\n\nA template gains nothing by rewriting its own output. The impact is on the Markup objects that come from the application and are also rendered elsewhere, like a global in a long-running worker. Their new content then ends up in trusted pages that aren't sandboxed.\n\nThe sandbox no longer allows calling the constructor of Markup objects.",
  "id": "CVE-2026-133770",
  "modified": "2026-11-24T14:46:01.157379106Z",
  "published": "2026-11-24T13:07:53.166Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/133xxx/CVE-2026-133770.json"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/twigphp/Twig"
    },
    {
      "type": "FIX",
      "url": "https://github.com/twigphp/Twig/commit/97b2e40b1165e6a42a197843f96ccb0a55f46f34"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/twigphp/Twig/security/advisories/GHSA-r34x-hh9h-9q9c"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-133770"
    },
    {
      "type": "WEB",
      "url": "https://packagist.org"
    },
    {
      "type": "ADVISORY",
      "url": "https://symfony.com/cve-2026-133770"
    }
  ],
  "schema_version": "1.9.2",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:P/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Sandboxed templates can rewrite application-owned `Markup` objects through their constructor"
}