CVE-2022-31181 Remote code execution in prestashop
Attackers can exploit SQL injection to execute arbitrary code via PHP eval, requiring an upgrade to PrestaShop.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-31181?
CVE-2022-31181 is a critical SQL injection vulnerability in Prestashop Prestashop, published on 1 Aug 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official 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.
Which versions are affected by CVE-2022-31181?
2 open source packages ship an affected version, including prestashop/prestashop. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
prestashop/prestashop Packagist | From 1.6.0.10 | 1.7.8.7 |
prestashop/prestashop Packagist | From 1.6.0.10 | 1.7.8.7 |
Products include Prestashop Prestashop.
How do I fix CVE-2022-31181?
Upgrade prestashop/prestashop to 1.7.8.7 or later.
Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.
Is CVE-2022-31181 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-31181 exists.
Public exploit code: 1 Nuclei template and 1 proofs of concept on GitHub.
Other vulnerabilities in Prestashop Prestashop
Sources
Also known as CVE-2022-36408, GHSA-hrgx-p36p-89q4.