{"id":"CVE-2022-31181","aliases":["EUVD-2022-6354","GHSA-hrgx-p36p-89q4"],"status":"published","title":"Remote code execution in prestashop","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.","severity":{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.07651,"percentile":0.94657,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":true,"fix_available":true},"cwes":["CWE-74","CWE-89","CWE-95"],"published":"2022-07-29T22:27:27Z","modified":"2026-10-28T02:31:03Z","exploits":[{"source":"nuclei","id":"CVE-2022-31181","title":"PrestaShop - SQL Injection to Eval Injection","type":"detection template","url":"https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2022/CVE-2022-31181.yaml"},{"source":"pocgithub","id":"drkbcn/lblfixer_cve_2022_31181","title":"drkbcn/lblfixer_cve_2022_31181","date":"2022-07-26","url":"https://github.com/drkbcn/lblfixer_cve_2022_31181"}],"fixes":[{"ecosystem":"Packagist","package":"prestashop/prestashop","fixed_in":["1.7.8.7"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Packagist","package":"prestashop/prestashop","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.6.0.10"},{"fixed":"1.7.8.7"}]}]},{"source":"osv","ecosystem":"Packagist","package":"prestashop/prestashop","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.6.0.10"},{"fixed":"1.7.8.7"}]}],"versions":["1.7.0.0","1.7.0.0-beta.1.0","1.7.0.0-beta.2.0","1.7.0.0-beta.3.0","1.7.0.0-beta.4.0","1.7.0.0-rc.0.0","1.7.0.0-rc.1.0","1.7.0.0-rc.2.0","1.7.0.1","1.7.0.2","1.7.0.3","1.7.0.4","1.7.0.5","1.7.0.6","1.7.1.0","1.7.1.1","1.7.1.2","1.7.2.0","1.7.2.0-rc.1.0","1.7.2.1","1.7.2.2","1.7.2.3","1.7.2.4","1.7.2.5","1.7.3.0","1.7.3.1","1.7.3.2","1.7.3.3","1.7.3.4","1.7.4.0","1.7.4.0-beta.1","1.7.4.1","1.7.4.2","1.7.4.3","1.7.4.4","1.7.5.0","1.7.5.0-beta.1","1.7.5.0-rc.1","1.7.5.1","1.7.5.2","1.7.6.0","1.7.6.0-beta.1","1.7.6.0-rc.1","1.7.6.0-rc.2","1.7.6.1","1.7.6.2","1.7.6.3","1.7.6.4","1.7.6.5","1.7.6.6","1.7.6.7","1.7.6.8","1.7.6.9","1.7.7.0","1.7.7.0-beta.1","1.7.7.0-beta.2","1.7.7.0-rc.1","1.7.7.1","1.7.7.2","1.7.7.3","1.7.7.4","1.7.7.5","1.7.7.6","1.7.7.7","1.7.7.8","1.7.8.0","1.7.8.0-beta.1","1.7.8.0-rc.1","1.7.8.1","1.7.8.2","1.7.8.3","1.7.8.4","1.7.8.5","1.7.8.6"]}],"products":[{"vendor":"prestashop","product":"prestashop"}],"references":[{"url":"https://github.com/PrestaShop/PrestaShop/security/advisories/GHSA-hrgx-p36p-89q4","tags":["x_refsource_CONFIRM","x_transferred","Mitigation","Third Party Advisory","advisory","web"]},{"url":"https://github.com/PrestaShop/PrestaShop/commit/b6d96e7c2a4e35a44e96ffbcdfd34439b56af804","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/PrestaShop/PrestaShop/releases/tag/1.7.8.7","tags":["x_refsource_MISC","x_transferred","Release Notes","Third Party Advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31181","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-hrgx-p36p-89q4"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31181.json","tags":["advisory"]},{"url":"https://github.com/PrestaShop/PrestaShop","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2022-31181","title":"Remote code execution in prestashop","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.","status":"published","published":"2022-08-01T19:30:16Z","modified":"2025-04-23T17:56:10.835Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"cna"}],"cwes":["CWE-89","CWE-74"],"updated_at":"2026-11-02T14:34:35.279735Z"}],"euvd":[{"id":"EUVD-2022-6354","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.","status":"published","published":"2022-08-01T19:30:16Z","modified":"2025-04-23T17:56:10Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T20:52:09.919052Z"}],"ghsa":[{"id":"GHSA-hrgx-p36p-89q4","title":"PrestaShop eval injection possible if shop vulnerable to SQL injection","description":"### 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-\u003ecaching_type = 'mysql';\n}\n```\n","status":"published","published":"2022-07-29T22:27:27Z","modified":"2023-01-27T05:07:52Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-89","CWE-95"],"updated_at":"2026-11-02T14:36:22.592333Z"}],"nvd":[{"id":"CVE-2022-31181","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.","status":"published","published":"2022-08-01T20:15:08.297Z","modified":"2026-06-17T04:44:58.52Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"secondary"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"}],"cwes":["CWE-74","CWE-89"],"updated_at":"2026-11-02T14:07:24.39467Z"}],"osv":[{"id":"CVE-2022-31181","title":"Remote code execution in prestashop","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.","status":"published","published":"2022-08-01T19:30:16Z","modified":"2026-10-28T02:31:03.191747129Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-74","CWE-89"],"updated_at":"2026-11-02T15:44:25.516981Z"},{"id":"GHSA-hrgx-p36p-89q4","title":"PrestaShop eval injection possible if shop vulnerable to SQL injection","description":"### 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-\u003ecaching_type = 'mysql';\n}\n```\n","status":"published","published":"2022-07-29T22:27:27Z","modified":"2023-11-08T04:09:29.075917Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-89","CWE-95"],"updated_at":"2026-11-02T15:46:49.621585Z"}]}}
