CVE-2022-23614
Published: 04 February 2022
Summary
CVE-2022-23614 is a high-severity Injection (CWE-74) vulnerability in Symfony Twig. Its CVSS base score is 8.8 (High).
Operationally, ranked in the top 4.2% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog.
Deeper analysis
Twig is an open source PHP template engine that supports a sandbox mode intended to restrict untrusted templates. CVE-2022-23614 is a code-injection flaw in affected versions where the arrow parameter of the sort filter was not properly constrained to accept only closures, contrary to the sandbox contract that applies to similar filters. This allowed injection of arbitrary PHP function calls when an attacker could supply template content or filter arguments.
An authenticated or otherwise low-privileged user able to influence Twig templates processed in sandbox mode could exploit the missing check to execute arbitrary PHP code, resulting in full compromise of confidentiality, integrity, and availability on the host. The vulnerability carries a CVSS 3.1 score of 8.8 with network attack vector and low complexity.
Public advisories and the referenced GitHub security advisory direct users to upgrade to patched Twig releases that now explicitly disallow non-Closure values for the sort filter arrow parameter; the fixes are tracked in commits 22b9dc3 and 2eb3308. Downstream Fedora package announcements also list updated builds for affected distributions.
EPSS for the CVE rose from lower values at disclosure to a peak of 0.4572 in late 2025 before receding to the current 0.2115, indicating a clear post-disclosure increase in observed exploitation interest.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2022-0842
Vulnerability details
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…
more
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.
- CWE(s)
Related Threats
No named actor attribution yet. ATT&CK technique mapping in progress for this CVE.
Affected Assets
Mitigating Controls
Likely Mitigating Controls AI
Per-CVE control mapping for this CVE has not run yet; the list below is derived from the weakness types (CWEs) cited in the NVD entry.
Developer assessments and testing (including injection-focused techniques) identify improper neutralization of special elements, and the verifiable flaw remediation corrects them pre-deployment.
Makes persistent code injection into loaded programs impossible when the executable image itself resides on hardware-protected read-only media.
Dynamically generated code can be produced and executed inside the isolated chamber, preventing host compromise from code-injection payloads.
Validates inputs used in dynamic code generation to block injected directives.
Directly prevents execution of attacker-supplied code written into data memory regions.
Identifies indicators of injection attacks (command, SQL, LDAP, etc.) via anomaly and attack monitoring.