Skip to content
Fencer Vulns
high 8.8

CVE-2022-23614 json

Code injection in Twig

published 2022-02-04 4 y ago modified 2026-06-17 4 mo ago also GHSA-5mv2-rx3q-4w2v , EUVD-2022-0842

cvss
8.8
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
8.2%
EPSS 8.2% chance of exploitation in 30 days, percentile 94%
public exploits
0
none known

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.

Patch / fix

  • packagist twig/twig 2.14.11, 3.3.8
  • symfony twig 2.14.11, 3.3.8
  • php-twig Debian 14, Debian 13, Debian 12 3.3.8-1

debian advisories DEBIAN-CVE-2022-23614

  • php-twig Ubuntu Pro 20.04 LTS 2.12.5-1ubuntu0.1~esm1

ubuntu advisories UBUNTU-CVE-2022-23614

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2022-23614 updated cvss 8.8

twig: Disallow non closures in `sort` filter when the sandbox mode is enabled

  • Red Hat All currently supported Red Hat products
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
total
Assessed
18 mo ago

Exploit prediction

8.21% chance of exploitation in the next 30 days, higher than 94% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 8.8 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD 2.0 7.5 AV:N/AC:L/Au:N/C:P/I:P/A:P
GitHub 3.1 8.8 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
packagist twig/twig
>=2.0.0, <2.14.11
>=3.0.0, <3.3.8
2.14.11
3.3.8

Affected products

  • twigphp Twig

Classification

Weakness
  • CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component
  • CWE-94 Improper Control of Generation of Code

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.