Miggo Logo

CVE-2022-31181: PrestaShop eval injection possible if shop vulnerable to SQL injection

9.8

CVSS Score
3.1

Basic Information

EPSS Score
0.9214%
Published
7/29/2022
Updated
1/27/2023
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
prestashop/prestashopcomposer>= 1.6.0.10, < 1.7.8.71.7.8.7

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability chain requires: 1. SQL injection to modify cached content (CWE-89), and 2. Evaluation of that content via Smarty (CWE-95). The pre-patch versions lacked encryption in these methods, making cached content manipulable through SQL injection. The commit added encryption/decryption to prevent code injection via cached content. These functions directly handle the storage and retrieval of template cache data that gets evaluated by Smarty, making them the critical vulnerable components.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Imp**t *v*l inj**tion possi*l* i* t** s*op is vuln*r**l* to *n SQL inj**tion. ### P*t***s T** pro*l*m is *ix** in v*rsion *.*.*.* ### Work*roun*s **l*t* t** MySQL Sm*rty ***** ***tur* *y r*movin* t**s* lin*s in t** *il* `*on*i*/sm*rty.*on*i*.in

Reasoning

T** vuln*r**ility ***in r*quir*s: *. SQL inj**tion to mo*i*y ****** *ont*nt (*W*-**), *n* *. *v*lu*tion o* t**t *ont*nt vi* `Sm*rty` (*W*-**). T** pr*-p*t** v*rsions l**k** *n*ryption in t**s* m*t*o*s, m*kin* ****** *ont*nt m*nipul**l* t*rou** SQL in