CVE-2022-23614

HIGH

Twig 2.0.0-2.14.11 - Remote Code Execution via Sort Filter Arrow Parameter

Title source: llm
STIX 2.1

Exploitation Summary

EIP tracks 2 public exploits for CVE-2022-23614. PoCs published by davwwwx, 4rtamis.

AI-analyzed exploit summary This repository contains a functional PoC for CVE-2022-23614, demonstrating a Twig sandbox bypass via the `sort` filter. The exploit leverages arbitrary callback execution in `uasort`, allowing RCE when user-supplied input is passed to the `system` function.

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.

Exploits (2)

nomisec WORKING POC 4 stars
by davwwwx · poc
https://github.com/davwwwx/CVE-2022-23614

This repository contains a functional PoC for CVE-2022-23614, demonstrating a Twig sandbox bypass via the `sort` filter. The exploit leverages arbitrary callback execution in `uasort`, allowing RCE when user-supplied input is passed to the `system` function.

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Trivial
Reliability
Reliable
Target: Twig (versions prior to the fix in commit 22b9dc3)
No auth needed
Prerequisites: Vulnerable Twig installation · Ability to submit Twig templates to the target application
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC
by 4rtamis · poc
https://github.com/4rtamis/CVE-2022-23614

This PoC demonstrates CVE-2022-23614, a sandbox bypass in Twig's sort filter allowing arbitrary PHP function execution. It uses a crafted template to exploit the vulnerability via command injection through the sort function parameter.

Classification
Working Poc 100%
Attack Type
Rce
Complexity
Trivial
Reliability
Reliable
Target: Twig (v2.14.1 for Debian php-twig, v2.14 for Composer twig/twig)
No auth needed
Prerequisites: Twig installed (via Debian package or Composer) · Ability to pass untrusted input to Twig template rendering
devstral-2 · analyzed Feb 16, 2026 Full analysis →

Scores

CVSS v3 8.8
EPSS 0.2115
EPSS Percentile 95.8%
Attack Vector NETWORK
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

CISA SSVC

Vulnrichment
Exploitation none
Automatable no
Technical Impact total

Details

CWE
CWE-74 CWE-94
Status published
Products (5)
debian/debian_linux 11.0
fedoraproject/fedora 34
fedoraproject/fedora 35
symfony/twig 2.0.0 - 2.14.11
twig/twig 2.0.0 - 2.14.11Packagist
Published Feb 04, 2022
Tracked Since Feb 18, 2026