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

Critical 10.0 Published Updated

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.

PackageAffectedFixed in
shopware/core PackagistAll versions6.4.18.1
shopware/core PackagistAll versions6.4.18.1
shopware/platform PackagistAll versions6.4.18.1
shopware/platform PackagistAll versions6.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.

All Shopware Shopware vulnerabilities

Sources

Also known as GHSA-93cw-f5jj-x85w.

Is CVE-2023-22731 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free