CVE-2023-22731 Improper Control of Generation of Code in Twig rendered views in shopware
Attackers with Twig access can execute arbitrary PHP code via filters if the Sandbox extension is disabled, requiring an upgrade to Shopware.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2023-22731?
CVE-2023-22731 is a critical code injection vulnerability in Shopware Shopware, published on 17 Jan 2023. Any signed-in user can exploit it over the network, with no action from the victim.
Official 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.
Weakness: CWE-94
Which versions are affected by CVE-2023-22731?
4 open source packages ship an affected version, including shopware/core and shopware/platform. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
shopware/core Packagist | All versions | 6.4.18.1 |
shopware/core Packagist | All versions | 6.4.18.1 |
shopware/platform Packagist | All versions | 6.4.18.1 |
shopware/platform Packagist | All versions | 6.4.18.1 |
Products include Shopware Shopware.
How do I fix CVE-2023-22731?
Upgrade shopware/core to 6.4.18.1 or later.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2023-22731 being exploited?
There is no known exploitation of CVE-2023-22731 in the wild and no public exploit code.
Other vulnerabilities in Shopware Shopware
- CVE-2016-3109 Shopware RCE Vulnerability
- CVE-2024-22406 Blind SQL-injection in DAL aggregations in Shopware
- CVE-2021-32711 Leak of information via Store-API
- CVE-2026-31887 Shopware unauthenticated data extraction possible through store-api.order endpoint
- CVE-2026-31889 Shopware has a potential take over of app credentials
Sources
Also known as GHSA-93cw-f5jj-x85w.