Ubuntu 16.04 ESM / 18.04 ESM / 20.04 ESM / 22.04 ESM : Twig vulnerabilities (USN-5947-1)

critical Nessus Plugin ID 172497

Synopsis

The remote Ubuntu host is missing one or more security updates.

Description

The remote Ubuntu 16.04 ESM / 18.04 ESM / 20.04 ESM / 22.04 ESM host has packages installed that are affected by multiple vulnerabilities as referenced in the USN-5947-1 advisory.

- A sandbox information disclosure exists in Twig before 1.38.0 and 2.x before 2.7.0 because, under some circumstances, it is possible to call the __toString() method on an object even if not allowed by the security policy in place. (CVE-2019-9942)

- 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. (CVE-2022-23614)

- Twig is a template language for PHP. Versions 1.x prior to 1.44.7, 2.x prior to 2.15.3, and 3.x prior to 3.4.3 encounter an issue when the filesystem loader loads templates for which the name is a user input. It is possible to use the `source` or `include` statement to read arbitrary files from outside the templates' directory when using a namespace like `@somewhere/../some.file`. In such a case, validation is bypassed.
Versions 1.44.7, 2.15.3, and 3.4.3 contain a fix for validation of such template names. There are no known workarounds aside from upgrading. (CVE-2022-39261)

Note that Nessus has not tested for these issues but has instead relied only on the application's self-reported version number.

Solution

Update the affected packages.

See Also

https://ubuntu.com/security/notices/USN-5947-1

Plugin Details

Severity: Critical

ID: 172497

File Name: ubuntu_USN-5947-1.nasl

Version: 1.2

Type: local

Agent: unix

Published: 3/13/2023

Updated: 10/20/2023

Supported Sensors: Agentless Assessment, Frictionless Assessment Agent, Frictionless Assessment AWS, Frictionless Assessment Azure, Nessus Agent, Nessus

Risk Information

VPR

Risk Factor: Medium

Score: 6.7

CVSS v2

Risk Factor: High

Base Score: 7.5

Temporal Score: 5.9

Vector: CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P

CVSS Score Source: CVE-2022-23614

CVSS v3

Risk Factor: Critical

Base Score: 9.8

Temporal Score: 8.8

Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Temporal Vector: CVSS:3.0/E:P/RL:O/RC:C

Vulnerability Information

CPE: cpe:/o:canonical:ubuntu_linux:16.04:-:esm, cpe:/o:canonical:ubuntu_linux:18.04:-:esm, cpe:/o:canonical:ubuntu_linux:20.04:-:esm, cpe:/o:canonical:ubuntu_linux:22.04:-:esm, p-cpe:/a:canonical:ubuntu_linux:php-twig, p-cpe:/a:canonical:ubuntu_linux:php-twig-cache-extra, p-cpe:/a:canonical:ubuntu_linux:php-twig-cssinliner-extra, p-cpe:/a:canonical:ubuntu_linux:php-twig-extra-bundle, p-cpe:/a:canonical:ubuntu_linux:php-twig-html-extra, p-cpe:/a:canonical:ubuntu_linux:php-twig-inky-extra, p-cpe:/a:canonical:ubuntu_linux:php-twig-intl-extra, p-cpe:/a:canonical:ubuntu_linux:php-twig-markdown-extra, p-cpe:/a:canonical:ubuntu_linux:php-twig-string-extra

Required KB Items: Host/cpu, Host/Ubuntu, Host/Ubuntu/release, Host/Debian/dpkg-l

Exploit Available: true

Exploit Ease: Exploits are available

Patch Publication Date: 3/13/2023

Vulnerability Publication Date: 3/23/2019

Reference Information

CVE: CVE-2019-9942, CVE-2022-23614, CVE-2022-39261

USN: 5947-1