Miggo Logo

CVE-2022-40199:
EC-CUBE Directory traversal vulnerability

2.7

CVSS Score
3.1

Basic Information

EPSS Score
0.62145%
Published
9/28/2022
Updated
4/25/2024
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
ec-cube/ec-cubecomposer>= 3.0.0, <= 3.0.18-p4
ec-cube/ec-cubecomposer>= 4.0.0, <= 4.1.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability manifests in three key locations shown in the patch diffs: 1) FileController's directory validation lacked '..' checking before realpath(), 2) PaymentController's file handling accepted unsanitized paths, and 3) ProductType's image validation didn't detect traversal sequences. All were patched by adding explicit '..' checks via strpos(), directly addressing the path traversal vulnerability. The functions handle user-controlled path inputs and were missing essential sanitization, matching both the CWE-22 description and the vendor's patch analysis.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

*ir**tory tr*v*rs*l vuln*r**ility in **-*U** * s*ri*s (**-*U** *.*.* to *.*.**-p* ) *n* **-*U** * s*ri*s (**-*U** *.*.* to *.*.*) *llows * r*mot* *ut**nti**t** *tt**k*r wit* *n **ministr*tiv* privil*** to o*t*in t** pro*u*t's *ir**tory stru*tur* in*o

Reasoning

T** vuln*r**ility m*ni**sts in t*r** k*y lo**tions s*own in t** p*t** *i**s: *) `*il**ontroll*r`'s *ir**tory `v*li**tion` l**k** '..' ****kin* ***or* `r**lp*t*()`, *) `P*ym*nt*ontroll*r`'s *il* **n*lin* ****pt** uns*nitiz** p*t*s, *n* *) `Pro*u*tTyp*