CVE-2022-23614
published high CVSS 3.1 · 8.8Code injection in Twig
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| twigphp | — | Twig>= 3.0.0, < 3.3.8 · >= 2.0.0, < 2.14.11 | Affected | Not stated | GitHub_M |
| Debian | bullseye | php-twig | Advisory build | 2.14.3-1+deb11u1 | DSA-5107-1 |
| Ubuntu | focal | php-twig | Advisory build | 2.12.5-1ubuntu0.1~esm1 | USN-5947-1 |
| Ubuntu | focal | php-twig-cssinliner-extra | Advisory build | 2.12.5-1ubuntu0.1~esm1 | USN-5947-1 |
| Ubuntu | focal | php-twig-extra-bundle | Advisory build | 2.12.5-1ubuntu0.1~esm1 | USN-5947-1 |
| Ubuntu | focal | php-twig-html-extra | Advisory build | 2.12.5-1ubuntu0.1~esm1 | USN-5947-1 |
| Ubuntu | focal | php-twig-inky-extra | Advisory build | 2.12.5-1ubuntu0.1~esm1 | USN-5947-1 |
| Ubuntu | focal | php-twig-intl-extra | Advisory build | 2.12.5-1ubuntu0.1~esm1 | USN-5947-1 |
Show 1 more entries
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Ubuntu | focal | php-twig-markdown-extra | Advisory build | 2.12.5-1ubuntu0.1~esm1 | USN-5947-1 |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 8.8 / 10
- Severity
- high
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| twigphp | Twig | >= 3.0.0, < 3.3.8 (affected)>= 2.0.0, < 2.14.11 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-74 CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
References
8- https://github.com/twigphp/Twig/commit/22b9dc3c03ee66d7e21d9ed2ca76052b134cb9e9
- https://github.com/twigphp/Twig/commit/2eb33080558611201b55079d07ac88f207b466d5
- https://github.com/twigphp/Twig/security/advisories/GHSA-5mv2-rx3q-4w2v
- FEDORA-2022-7d871d7583 https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/I2PVV5DUTRUECTIHMTWRI5Z7DVNYQ2YO/
- FEDORA-2022-167b9becef https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OTN4273U4RHVIXED64T7DSMJ3VYTPRE7/
- FEDORA-2022-47293b1d23 https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PECHIY2XLWUH2WLCNPDGNFMPHPRPCEDZ/
- FEDORA-2022-58abb323f0 https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SIGZCFSYLPP7UVJ4E4NLHSOQSKYNXSAD/
- DSA-5107 https://www.debian.org/security/2022/dsa-5107
Provider assertions
3GitHub_M · cna
Code injection in Twig
CISA-ADP · adp
CISA ADP Vulnrichment
CVE · adp
CVE Program Container
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 1cbf823b18f58a0b0d8eb480446d6277c705488fdeaf972daa4f149350969232
- Ingested
- 23 Sep 2026, 07:58:41 UTC
- Source record
- Official CVE record