{"id":"CVE-2022-31181","aliases":["CVE-2022-31181","GHSA-hrgx-p36p-89q4"],"related":[],"kind":"vulnerability","state":"published","title":"Remote code execution in prestashop","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\nEval injection possible if the shop is vulnerable to an SQL injection.\n\n### Patches\nThe problem is fixed in version 1.7.8.7\n\n### Workarounds\nDelete 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):\n```php\nif (Configuration::get('PS_SMARTY_CACHING_TYPE') == 'mysql') {\n    include _PS_CLASS_DIR_.'Smarty/SmartyCacheResourceMysql.php';\n    $smarty->caching_type = 'mysql';\n}\n```","format":"markdown","source":"ghsa"},{"lang":"es","text":"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","source":"nvd"}],"published":"2022-07-29T22:27:27.000Z","modified":"2026-06-17T04:44:58.520Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-74","CWE-89","CWE-95"],"affected":[{"ranges":[{"version":">= 1.6.0.10, < 1.7.8.7","status":"affected"}],"vendor":"PrestaShop","product":"PrestaShop","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.6.0.10","status":"affected","fixed":"1.7.8.7"}],"ecosystem":"Packagist","package":"prestashop/prestashop","purl":"pkg:composer/prestashop/prestashop","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"1.6.0.10","fixed":"1.7.8.7"}],"vendor":"prestashop","product":"prestashop","cpe":"cpe:2.3:a:prestashop:prestashop:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-hrgx-p36p-89q4","tags":["mitigation","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/PrestaShop/PrestaShop/commit/b6d96e7c2a4e35a44e96ffbcdfd34439b56af804","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/PrestaShop/PrestaShop/releases/tag/1.7.8.7","tags":["release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31181","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/PrestaShop/PrestaShop","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2025-04-23T15:48:50.998Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-31181","url":"https://www.cve.org/CVERecord?id=CVE-2022-31181","licence":"CVE Terms of Use","modified":"2025-04-23T17:56:10.835Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hrgx-p36p-89q4","url":"https://github.com/advisories/GHSA-hrgx-p36p-89q4","licence":"CC-BY-4.0","modified":"2023-11-08T04:09:29.075Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-31181","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31181","licence":"Public domain","modified":"2026-06-17T04:44:58.520Z"}],"updatedAt":"2026-11-25T22:58:13.344Z","epss":{"score":0.07651,"percentile":0.9471,"date":"2026-12-01T12:00:22.000Z"}}