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 productsnot 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
References
-
github.com
/twigphp/Twig/commit/22b9dc3c03ee66d7e21d9ed2ca76052b134cb9e9
web, patch, third-party-advisory
-
github.com
/twigphp/Twig/commit/2eb33080558611201b55079d07ac88f207b466d5
web, patch, third-party-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/OTN4273U4RHVIXED64T7DSMJ3VYTPRE7/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/PECHIY2XLWUH2WLCNPDGNFMPHPRPCEDZ/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/I2PVV5DUTRUECTIHMTWRI5Z7DVNYQ2YO/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/SIGZCFSYLPP7UVJ4E4NLHSOQSKYNXSAD/
vendor-advisory
-
debian.org
/security/2022/dsa-5107
vendor-advisory, web, third-party-advisory
-
github.com
/twigphp/Twig/security/advisories/GHSA-5mv2-rx3q-4w2v
web, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2022-23614
advisory
-
github.com
/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2022-23614.yaml
web
-
github.com
/twigphp/Twig
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/I2PVV5DUTRUECTIHMTWRI5Z7DVNYQ2YO
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/OTN4273U4RHVIXED64T7DSMJ3VYTPRE7
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/PECHIY2XLWUH2WLCNPDGNFMPHPRPCEDZ
web
-
lists.fedoraproject.org
/archives/list/package-announce@lists.fedoraproject.org/message/SIGZCFSYLPP7UVJ4E4NLHSOQSKYNXSAD
web
-
symfony.com
/blog/twig-security-release-disallow-non-closures-in-the-sort-filter
web
Sources
- CVE List CVE-2022-23614
- GitHub Advisory GHSA-5mv2-rx3q-4w2v
- NVD CVE-2022-23614
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.