CVE Vulnerabilities

CVE-2022-23614

Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

Published: Feb 04, 2022 | Modified: Nov 21, 2024
CVSS 3.x
9.8
CRITICAL
Source:
NVD
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.x
7.5 HIGH
AV:N/AC:L/Au:N/C:P/I:P/A:P
RedHat/V2
RedHat/V3
8.8 MODERATE
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Ubuntu
MEDIUM

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.

Weakness

The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.

Affected Software

Name Vendor Start Version End Version
Twig Symfony 2.0.0 (including) 2.14.11 (excluding)
Twig Symfony 3.0.0 (including) 3.3.8 (excluding)
Php-twig Ubuntu esm-apps/focal *
Php-twig Ubuntu focal *
Php-twig Ubuntu trusty *
Php-twig Ubuntu upstream *
Php-twig Ubuntu xenial *
Twig Ubuntu trusty *
Twig Ubuntu upstream *
Twig Ubuntu xenial *

Potential Mitigations

References