CVE-2022-31181
JSON

9.8critical

Remote code execution in prestashop

Severity
9.8critical CVSS:3.1 by GitHub_M
Exploit likelihood
7.65% (higher than 94% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-hrgx-p36p-89q4

Description

PrestaShop is an Open Source e-commerce platform. In versions from 1.6.0.10 and before 1.7.8.7 PrestaShop is subject to an SQL injection vulnerability which can be chained to call PHP's Eval function on attacker input. The problem is fixed in version 1.7.8.7. Users are advised to upgrade. Users unable to upgrade may delete the MySQL Smarty cache feature.

Affected

Product or packageVersionsReported by
PrestaShop PrestaShop>= 1.6.0.10, < 1.7.8.7, from 1.6.0.10 before 1.7.8.7CVE List, NVD
prestashop/prestashop (Packagist)from 1.6.0.10 before 1.7.8.7GitHub Advisory Database

All scores

GitHub_M9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-74CWE-89CWE-95

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.

What each source says

CVE List

PrestaShop is an Open Source e-commerce platform. In versions from 1.6.0.10 and before 1.7.8.7 PrestaShop is subject to an SQL injection vulnerability which can be chained to call PHP's Eval function on attacker input. The problem is fixed in version 1.7.8.7. Users are advised to upgrade. Users unable to upgrade may delete the MySQL Smarty cache feature.

GitHub Advisory Database
Impact

Eval injection possible if the shop is vulnerable to an SQL injection.

Patches

The problem is fixed in version 1.7.8.7

Workarounds

Delete the MySQL Smarty cache feature by removing these lines in the file config/smarty.config.inc.php lines 43-46 (PrestaShop 1.7) or 40-43 (PrestaShop 1.6):

if (Configuration::get('PS_SMARTY_CACHING_TYPE') == 'mysql') {
    include _PS_CLASS_DIR_.'Smarty/SmartyCacheResourceMysql.php';
    $smarty->caching_type = 'mysql';
}
NVD (es)

PrestaShop es una plataforma de comercio electrónico de código abierto. En las versiones a partir de 1.6.0.10 y anteriores a 1.7.8.7, PrestaShop está sujeta a una vulnerabilidad de inyección SQL que puede ser encadenada para llamar a la función Eval de PHP en la entrada del atacante. El problema ha sido solucionado en versión 1.7.8.7. Es recomendado a usuarios actualizar. Los usuarios que no puedan actualizar pueden eliminar la función de caché MySQL Smarty

References

Sources

SourceRecordLicence
CVE ListCVE-2022-31181 changed 2025-04-23CVE Terms of Use
GitHub Advisory DatabaseGHSA-hrgx-p36p-89q4 changed 2023-11-08CC-BY-4.0
NVDCVE-2022-31181 changed 2026-06-17Public domain