CVE-2023-22731
JSON

10.0critical

Improper Control of Generation of Code in Twig rendered views in shopware

Severity
10.0critical CVSS:3.1 by GitHub_M
Exploit likelihood
1.44% (higher than 73% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-93cw-f5jj-x85w

Description

Shopware is an open source commerce platform based on Symfony Framework and Vue js. In a Twig environment **without the Sandbox extension**, it is possible to refer to PHP functions in twig filters like `map`, `filter`, `sort`. This allows a template to call any global PHP function and thus execute arbitrary code. The attacker must have access to a Twig environment in order to exploit this vulnerability. This problem has been fixed with 6.4.18.1 with an override of the specified filters until the integration of the Sandbox extension has been finished. Users are advised to upgrade. Users of major versions 6.1, 6.2, and 6.3 may also receive this fix via a plugin.

Affected

Product or packageVersionsReported by
shopware platform< 6.4.18.1CVE List
shopware/platform (Packagist)before 6.4.18.1GitHub Advisory Database
shopware/core (Packagist)before 6.4.18.1GitHub Advisory Database
shopware shopwarebefore 6.4.18.1NVD

All scores

GitHub_M10.0critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-94

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

Shopware is an open source commerce platform based on Symfony Framework and Vue js. In a Twig environment **without the Sandbox extension**, it is possible to refer to PHP functions in twig filters like `map`, `filter`, `sort`. This allows a template to call any global PHP function and thus execute arbitrary code. The attacker must have access to a Twig environment in order to exploit this vulnerability. This problem has been fixed with 6.4.18.1 with an override of the specified filters until the integration of the Sandbox extension has been finished. Users are advised to upgrade. Users of major versions 6.1, 6.2, and 6.3 may also receive this fix via a plugin.

GitHub Advisory Database
Impact

In Twig environment without the Sandbox extension, it is possible to refer to PHP functions in twig filters like map, filter, sort. This allows in the template to call any global PHP function.

Patches

The problem has been fixed with 6.4.18.1 with an override of the specified filters until the integration of the Sandbox extension has been finished.

Workarounds

For older versions of 6.1, 6.2, and 6.3, corresponding security measures are also available via a plugin. For the full range of functions, we recommend updating to the latest Shopware version.

References

https://docs.shopware.com/en/shopware-6-en/security-updates/security-update-01-2023?category=security-updates

NVD (es)

Shopware es una plataforma de comercio de código abierto basada en Symfony Framework y Vue js. En un entorno Twig **sin la extensión Sandbox**, es posible hacer referencia a funciones PHP en filtros twig como `mapa`, `filtro`, `ordenar`. Esto permite que una plantilla llame a cualquier función PHP global y así ejecute código arbitrario. El atacante debe tener acceso a un entorno Twig para poder explotar esta vulnerabilidad. Este problema se solucionó con 6.4.18.1 con una anulación de los filtros especificados hasta que finalice la integración de la extensión Sandbox. Se recomienda a los usuarios que actualicen. Los usuarios de las versiones principales 6.1, 6.2 y 6.3 también pueden recibir esta solución a través de un complemento.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-22731 changed 2025-03-10CVE Terms of Use
GitHub Advisory DatabaseGHSA-93cw-f5jj-x85w changed 2023-11-08CC-BY-4.0
NVDCVE-2023-22731 changed 2026-06-17Public domain