Track vulnerabilities like this one. Sign up free to get alerted when software you use is affected.
9.9

CVE-2023-22731: Shopware templates can run arbitrary PHP code

CVE-2023-22731 · published 3 years ago
Summary

Shopware versions that use Twig without the Sandbox extension allow templates to call any PHP function, letting an attacker run code on the server. This requires the attacker to already have access to the Twig rendering process. Update to version 6.4.18.1 or apply the provided plugin for earlier 6.1‑6.3 releases to protect your system.

What to do
  • Update shopware platform to version 6.4.18.1.
  • Update shopware core to version 6.4.18.1.
  • Update shopware shopware to version 6.4.18.1 or later.
Affected software
Ecosystem VendorProductAffected versions
composer shopware platform <= 6.4.18.0
Fix: upgrade to 6.4.18.1
composer shopware core <= 6.4.18.0
Fix: upgrade to 6.4.18.1
– shopware shopware < 6.4.18.1
cpe:2.3:a:shopware:shopware:*:*:*:*:*:*:*:*
Original advisory text
Improper Control of Generation of Code in Twig rendered views in shopware
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.
Fix within
Internet-facing 14 days
Internal At next upgrade
  • Not known to be exploited
  • Needs hands-on effort to exploit
  • Gives an attacker full control
Severity
9.9 Critical
Exploitation
1% chance of attack within 30 days
Type
CWE-94Code Injection
Timeline
Published17 Jan 2023
Updated31 Oct 2026
First seen6 Mar 2026
Sources
Track software like this
Free during beta