Miggo Logo

CVE-2023-2017:
Improper Control of Generation of Code in Twig rendered views

8.8

CVSS Score

Basic Information

EPSS Score
-
Published
4/18/2023
Updated
4/28/2023
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
shopware/platformcomposer<= 6.4.20.06.4.20.1
shopware/corecomposer<= 6.4.20.06.4.20.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the SecurityExtension class's Twig filter implementations (map, filter, reduce, sort). These functions validated only string-based callables against an allow list, but failed to check array-based callables (e.g., [ClassName, 'method']). This allowed attackers to bypass the allow list by crafting array-format PHP closures, leading to arbitrary code execution. The STAR Labs report demonstrates concrete exploitation via these filters using static method calls (e.g., CacheValueCompressor::uncompress, VarDumper::setHandler), confirming the vulnerability pattern. The functions' code structure (checking only is_string) and the documented bypass methods justify high confidence.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t W* *ix** wit* [*V*-****-*****](*ttps://*it*u*.*om/s*opw*r*/pl*t*orm/s**urity/**visori*s/**S*-***w-**jj-x**w) Twi* *ilt*rs to only ** *x**ut** wit* *llow** *un*tions. It is possi*l* to p*ss P*P *losur*s *s strin* or *n *rr*y *n* *rr*y *r**t

Reasoning

T** vuln*r**ility st*ms *rom t** S**urity*xt*nsion *l*ss's Twi* *ilt*r impl*m*nt*tions (m*p, *ilt*r, r**u**, sort). T**s* *un*tions v*li**t** only strin*-**s** **ll**l*s ***inst *n *llow list, *ut **il** to ****k *rr*y-**s** **ll**l*s (*.*., [*l*ssN*