{
  "affected": [
    {
      "ranges": [
        {
          "database_specific": {
            "extracted_events": [
              {
                "range": [
                  {
                    "fixed": "7af821c372f52cc9447afeba9e042de44b738222"
                  }
                ],
                "source": "REFERENCES_COMMIT"
              }
            ]
          },
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "7af821c372f52cc9447afeba9e042de44b738222"
            }
          ],
          "repo": "https://github.com/twigphp/twig",
          "type": "GIT"
        }
      ]
    }
  ],
  "aliases": [
    "GHSA-56wp-8m9q-4354"
  ],
  "database_specific": {
    "cna_assigner": "Symfony",
    "cwe_ids": [
      "CWE-693",
      "CWE-863"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/133xxx/CVE-2026-133766.json",
    "unresolved_ranges": [
      {
        "extracted_events": [
          {
            "range": [
              {
                "introduced": "3.28.0"
              },
              {
                "fixed": "3.31.1"
              }
            ],
            "source": "AFFECTED_FIELD",
            "strategy": "StandardRange"
          }
        ]
      }
    ]
  },
  "details": "Since Twig 3.28.0, the sandbox skips the toString() check of an argument whose PHP parameter can't hold a string, like an int. A spread argument was mapped to a single parameter, although it fills every parameter from its position on. A sandboxed template could therefore call a denied toString() method:\n\n{{ tag(...[1, obj]) }}\n\nHere, the first parameter of tag() is an int, and a later one accepts strings. Applications are affected when they allow such a function, filter or test in the sandbox. No built-in callable is affected.\n\nA spread argument is now checked unless every parameter that it can fill has a safe type.",
  "id": "CVE-2026-133766",
  "modified": "2026-11-24T14:45:34.431070575Z",
  "published": "2026-11-24T13:07:49.491Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/133xxx/CVE-2026-133766.json"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/twigphp/Twig"
    },
    {
      "type": "FIX",
      "url": "https://github.com/twigphp/Twig/commit/7af821c372f52cc9447afeba9e042de44b738222"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/twigphp/Twig/security/advisories/GHSA-56wp-8m9q-4354"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-133766"
    },
    {
      "type": "WEB",
      "url": "https://packagist.org"
    },
    {
      "type": "ADVISORY",
      "url": "https://symfony.com/cve-2026-133766"
    }
  ],
  "schema_version": "1.9.2",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Sandbox `__toString()` policy bypass via spread arguments"
}