CVE-2022-31181 Remote code execution in prestashop

Critical 9.8 Published Updated

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.

Weakness: CWE-89, CWE-74

Which versions are affected by CVE-2022-31181?

2 open source packages ship an affected version, including prestashop/prestashop. It affects 1 product.

PackageAffectedFixed in
prestashop/prestashop PackagistFrom 1.6.0.101.7.8.7
prestashop/prestashop PackagistFrom 1.6.0.101.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.

All Prestashop Prestashop vulnerabilities

Sources

Also known as CVE-2022-36408, GHSA-hrgx-p36p-89q4.

Is CVE-2022-31181 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free