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 | Vendor | Product | Affected 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.
References
- https://github.com/advisories/GHSA-93cw-f5jj-x85w
- https://docs.shopware.com/en/shopware-6-en/security-updates/security-update-01-2... URL
- https://github.com/shopware/platform/security/advisories/GHSA-93cw-f5jj-x85w Vendor Advisory
- https://nvd.nist.gov/vuln/detail/CVE-2023-22731 Vendor Advisory
- https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/22xxx/CVE-2023-22731... Vendor Advisory
- https://github.com/shopware/platform/commit/89d1ea154689cb6202e0d3a0ceeae0febb0c... Patch
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
Type
CWE-94Code Injection
Timeline
Published17 Jan 2023
Updated31 Oct 2026
First seen6 Mar 2026
Track software like this
Free during beta