# CVE-2022-23614: Code injection in Twig

- Severity: High 8.8 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 8.41%, higher than 95% of CVEs (2026-12-01)
- Published: 2022-02-04T22:25:11.000Z
- Modified: 2026-06-17T04:30:29.140Z
- Also known as: GHSA-5mv2-rx3q-4w2v
- Weaknesses: CWE-74, CWE-94
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- twigphp Twig: >= 3.0.0, < 3.3.8; >= 2.0.0, < 2.14.11
- twig/twig (Packagist): from 2.0.0 before 2.14.11; from 3.0.0 before 3.3.8
- symfony twig: from 2.0.0 before 2.14.11; from 3.0.0 before 3.3.8
- fedoraproject fedora: 34; 35
- debian debian_linux: 11.0

## Every score

- GitHub_M: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 7.5 High `AV:N/AC:L/Au:N/C:P/I:P/A:P`

## References

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

## Sources

- CVE List: [CVE-2022-23614](https://www.cve.org/CVERecord?id=CVE-2022-23614), CVE Terms of Use, modified 2025-04-23
- GitHub Advisory Database: [GHSA-5mv2-rx3q-4w2v](https://github.com/advisories/GHSA-5mv2-rx3q-4w2v), CC-BY-4.0, modified 2024-02-16
- NVD: [CVE-2022-23614](https://nvd.nist.gov/vuln/detail/CVE-2022-23614), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-23614 · Whole record: https://cve.day/CVE-2022-23614.json · Rebuilt by cve.day 2026-11-25T22:58:09.535Z
