CVE-2026-23498

Shopware 6: Mapping Your Way to RCE via Twig Type Juggling

Alon Barad
Alon Barad
Software Engineer

Jan 14, 2026·5 min read·8 visits

Executive Summary (TL;DR)

Shopware tried to sandbox Twig by checking if function names were allowlisted strings. They forgot that PHP functions can also be called as arrays (e.g., `['Class', 'Method']`). This vulnerability exploits that oversight to bypass the sandbox completely, turning a simple template rendering engine into a remote shell.

A critical logic flaw in Shopware 6's Twig SecurityExtension allows attackers to bypass the function allowlist. By leveraging PHP's loose typing and passing array-based callables to the 'map' filter, attackers can evade security checks and execute arbitrary PHP methods, leading to Remote Code Execution (RCE).

Fix Analysis (1)

Technical Appendix

CVSS Score
9.8/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected Systems

Shopware 6 CoreShopware 6 ProfessionalShopware 6 Enterprise

Affected Versions Detail

Product
Affected Versions
Fixed Version
Shopware 6
Shopware
< 6.6.x (Patched Jan 2026)Post-Jan-5-2026 Release
AttributeDetail
Attack VectorNetwork (Twig Template Injection)
CVSS v3.19.8 (Critical)
CWE IDCWE-843
CWE NameAccess of Resource Using Incompatible Type ('Type Confusion')
ImpactRemote Code Execution (RCE)
Exploit StatusProof of Concept (PoC)
CWE-843
Access of Resource Using Incompatible Type ('Type Confusion')

The program allocates or initializes a resource using one type, but it later accesses that resource using a type that is incompatible with the original type.

Vulnerability Timeline

Fix committed by Jonas Elfering
2026-01-05
Vulnerability tracked in security feeds
2026-01-13
Deep dive analysis completed
2026-01-14