RCE in Symfony Twig
CVE-2022-23614
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.
Published · last modified .
CVSS v3 metric
CVSS v3 base score 8.8 (High). Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
EPSS exploit prediction
EPSS 0.082, 95.0th percentile (scored ); unchanged over 30 days. About EPSS.
Affected products
- Symfony Twig
- Twigphp Twig — versions >= 3.0.0, < 3.3.8, >= 2.0.0, < 2.14.11
- Debian Linux — versions 11.0
- Fedoraproject Fedora — versions 34, 35
Weakness classification (CWE)
Public exploits and proof-of-concept code
2 public repositories with exploit or proof-of-concept code for this CVE:
- davwwwx/CVE-2022-23614 (4 stars, last pushed 2022-07-18): PoC for CVE-2022-23614 (Twig sort filter code execution/sandbox bypass)
- 4rtamis/CVE-2022-23614 (last pushed 2023-07-04): Proof of concept for CVE-2022-23614 (command injection in Twig)
Also mentioned in 15 other repositories (ARPSyndicate/cvemon, dcmasllorens/Auditoria-Projecte-002, Ivanich41/mctf-hey-bro-nice-cat, …). These reference the CVE in a list, notes or a scanner and are not exploit code for it.
References
- github.com/twigphp/Twig/security/advisories/GHSA-5mv2-rx3q-4w2v (Third Party Advisory)
- github.com/twigphp/Twig/commit/22b9dc3c03ee66d7e21d9ed2ca76052b134cb9e9 (Patch, Third Party Advisory)
- github.com/twigphp/Twig/commit/2eb33080558611201b55079d07ac88f207b466d5 (Patch, Third Party Advisory)
- FEDORA-2022-167b9becef (vendor-advisory)
- FEDORA-2022-47293b1d23 (vendor-advisory)
- FEDORA-2022-7d871d7583 (vendor-advisory)
- FEDORA-2022-58abb323f0 (vendor-advisory)
- DSA-5107 (vendor-advisory, Third Party Advisory)
This CVE has public exploit evidence. See the latest CVEs with public exploits.