Skip to content
RCE Write-up Advanced

(CVE-2023-2017) Shopware 6 Server-side Template Injection (SSTI) via Twig Security Extension

The Twig SecurityExtension in Shopware 6 could be bypassed using array-style callables, letting a user with admin panel login access call arbitrary PHP functions and execute code.

Ngo Wei Lin Follow

Published on starlabs.sg

Shopware is an open source commerce platform based on Symfony Framework and Vue js. The build-in Shopware 6 Storefront is based on Twig and Bootstrap.

Ngo Wei Lin (@Creastery), on starlabs.sg

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The validation only ran when the callable argument was a string, so array-style callables bypassed the allow-list and were invoked as variable functions.

Impact

A user with login access to the Shopware Admin panel may be able to execute arbitrary code or commands on the server.

What the attacker needed

Login access to the Shopware Admin panel

The fix

Users are advised to upgrade to v6.4.20.1 to resolve the issue.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Shopware uses Twig templates. A security check in Shopware's Twig extension could be bypassed by supplying callables as an array of strings, allowing arbitrary PHP functions to run.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Ngo Wei Lin

View all

3 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.