Skip to main content
← All vulnerabilities
CVE-2022-23614GHSA-5MV2-RX3Q-4W2V

Code injection in Twig

Published
Last modified
published
Not listed in CISA KEV
Fix
Fixed in 3.3.8, 2.14.11
2 proofs of concept on GitHub
  • Exploitation: none
  • Automatable: no
  • Technical impact: total

Summary

Twig is an open source template language for PHP. When in a sandbox mode, the `arrow` parameter of the `sort` filter must be a closure to avoid attackers being able to run arbitrary PHP functions. In affected versions this constraint was not properly enforced and could lead to code injection of arbitrary PHP code. Patched versions now disallow calling non Closure in the `sort` filter as is the case for some other filters. Users are advised to upgrade.

Timeline

  1. CVE published
  2. CISA SSVC assessment

    Exploitation: none · Automatable: no · Technical impact: total

  3. Record last updated

Affected versions

  • twigphp Twig

    From 3.0.0 · fixed in 3.3.8; From 2.0.0 · fixed in 2.14.11

  • twig/twigPackagist

    From 2.0.0 · fixed in 2.14.11

  • twig/twigPackagist

    From 3.0.0 · fixed in 3.3.8

References 10

GitHub · twigphp/Twig

lists.fedoraproject.org

debian.org

GitHub · 4rtamis/CVE-2022-23614

GitHub · davwwwx/CVE-2022-23614