Read the docs
TI-2022-07667 Aliases CVE-2022-23614GHSA-5mv2-rx3q-4w2v

Code injection in Twig

Priority MEDIUM 54CWE-74Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
Low
Impact type
Code execution
Confidentiality · integrity · availability
High · High · High
Fix status
Fixed

Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-94.

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.

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.08209 94th percentileScored 2026-11-07
Fix Fixed Twig (twigphp): 3.3.8, 2.14.11twig/twig (Packagist): 2.14.11, 3.3.8

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
No
Technical impact
Total

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
symfonyTwig3.0.0 to before 3.3.8; 2.0.0 to before 2.14.113.3.8, 2.14.11Patch availableCNA
—twig/twig (Packagist)2.0.0 to before 2.14.112.14.11Patch availableGHSA-5mv2-rx3q-4w2v
—twig/twig (Packagist)3.0.0 to before 3.3.83.3.8Patch availableGHSA-5mv2-rx3q-4w2v
  • Twig Vendorsymfony Affected 3.0.0 to before 3.3.8; 2.0.0 to before 2.14.11 Fixed in 3.3.8, 2.14.11 Patch available CNA
  • twig/twig (Packagist) Vendor— Affected 2.0.0 to before 2.14.11 Fixed in 2.14.11 Patch available GHSA-5mv2-rx3q-4w2v
  • twig/twig (Packagist) Vendor— Affected 3.0.0 to before 3.3.8 Fixed in 3.3.8 Patch available GHSA-5mv2-rx3q-4w2v

CPE configurations NVD · 4

CPEVersionsRoleVendor
cpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:*2.0.0 to before 2.14.11; 3.0.0 to before 3.3.8Vulnerablesymfony
cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*34VulnerableFedoraproject
cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*35VulnerableFedoraproject
cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*11.0VulnerableDebian
  • cpe:2.3:a:symfony:twig:*:*:*:*:*:*:*:* Versions 2.0.0 to before 2.14.11; 3.0.0 to before 3.3.8 Vulnerable ·symfony
  • cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* Versions 34 Vulnerable ·Fedoraproject
  • cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* Versions 35 Vulnerable ·Fedoraproject
  • cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* Versions 11.0 Vulnerable ·Debian

Remediation

  • Fix · CNA Twig (twigphp) Fixed in 3.3.8, 2.14.11
  • Fix · GHSA-5mv2-rx3q-4w2v twig/twig (Packagist) Fixed in 2.14.11 Advisory →
  • Fix · GHSA-5mv2-rx3q-4w2v twig/twig (Packagist) Fixed in 3.3.8 Advisory →

Vendor assessments

Red Hat

Red Hat's page for this CVE →

Not affected: 1 product
  • Red Hat

Timeline

  1. 2026-10-02 Threatist record created from CVE-2022-23614
  2. 2026-10-03 Alias added: GHSA-5mv2-rx3q-4w2v

References

  • TI-2026-34283 Twig: The `spaceless` filter implicitly marks its output as safe CVSS 4.0MEDIUM 5.1
  • TI-2018-10028 Twig before 2.4.4 allows Server-Side Template Injection (SSTI) via the search search_key… CVSS 3.0CRITICAL 9.8
  • TI-2022-18637 Twig may load a template outside a configured directory when using the filesystem loader CVSS 3.1HIGH 7.5
  • TI-2026-34292 Twig: Arbitrary PHP code execution via `_self.(<string>)` macro-reference compilation CVSS 4.0HIGH 8.7
  • TI-2026-34285 Twig: PHP code injection via `{% use %}` template name CVSS 4.0HIGH 8.7
  • TI-2026-19691 Twig 2.16.x & 3.9.0-3.25.x Sandbox Bypass via SourcePolicyInterface CVSS 4.0HIGH 8.7
See all 24 →

Sources