#PrestaShop Security

CVE-2021-3110: SQL injection in PrestaShop — productcomments CommentGrade controller

PrestaShop and CVE-2021-3110: a practical explanation of SQL injection in productcomments CommentGrade controller, real-world impact, affected versions and a clear remediation checklist.

CVE-2021-3110: SQL injection in PrestaShop — productcomments CommentGrade controller

If you run a PrestaShop store, there is a big difference between running older software and being exposed to a particular vulnerability. CVE-2021-3110 concerns productcomments CommentGrade controller. Here is what was reported, which technical conditions matter and how to fix the issue without turning a maintenance task into a production incident.

What happened?

The id_products[] parameter in comment grading exposed time-based blind SQL injection.

The issue was reported in functionality associated with the PrestaShop application. Whether the entry point is reachable, the required privileges and local configuration can significantly change exposure.

The technical details: how this vulnerability works

SQL injection occurs when HTTP input changes the structure of a database query instead of remaining ordinary data. In PrestaShop, relevant surfaces include module controllers, Db::getInstance() queries and parameters used for filters, identifiers or sorting. Casting an ID to an integer can help, but does not make arbitrary strings safe or replace parameterization and strict allowlists for column names.

With blind SQL injection, the application does not need to show query results. Response differences or timing can still disclose information. The actual impact depends on the database account's privileges, available data and the exposed entry point.

What is the real impact?

Under the relevant conditions, the issue may allow unauthorized access to customer, order or configuration records and possibly modification of data, depending on database privileges. That does not establish that a store has been compromised, nor does it mean every installation is exploitable in the same way. Severity in practice depends on versions, configuration, authentication requirements and server privileges.

Also distinguish a vulnerability in the PrestaShop core from a vulnerability in a third-party module. The presence of a vulnerable extension is not implied merely by using PrestaShop.

Which versions are affected?

  • Component: productcomments CommentGrade controller
  • Reported affected versions: 1.7.7.0
  • Fixed version: unconfirmed
  • Advisory publication: 2021-01-20

Treat this as an initial assessment. Custom overrides, local patches and modified distributions mean the back-office version number might not describe every file currently deployed.

How do you fix CVE-2021-3110?

  1. Inventory the installation. Record the PrestaShop version, module version where applicable and PHP environment. Confirm whether productcomments CommentGrade controller is present.
  2. Check affected versions. The record lists 1.7.7.0. Verify these details against the maintainer's notice because configuration requirements can narrow exposure.
  3. Create a full backup. Include files, database and configuration, and test the change in staging whenever possible.
  4. Apply the remediation. I could not verify a sufficiently documented fixed version for this record. That does not mean no fix exists. Check the vendor advisory and changelog, and consider disabling the affected feature temporarily until you have a validated patch.
  5. Regression-test critical workflows. Check login, cart, checkout, customer area, back office, email and store integrations.
  6. Review prior exposure. A successful patch does not by itself establish whether the issue was previously exploited.

How can I check for exploitation attempts?

Inspect HTTP logs for unusual filter, sorting or ID parameters in the affected controller. Correlate them with the MariaDB/MySQL slow-query log and database logs when available. A suspicious request alone is not proof that data was extracted.

Cloudflare or another WAF may reduce some exploit attempts, but it does not patch vulnerable application code.

Developer review checklist

Start code review at the affected component above. Trace input from HTTP (Tools::getValue(), AJAX handlers, uploads or headers) into the sensitive operation and confirm server-side validation at that boundary. Also check custom overrides and in-house modules so the same unsafe pattern is not reintroduced after installing the official patch.

Want someone to handle the update?

A safe remediation is more than clicking an update button. Dependencies need reviewing, rollback must be possible, the right patch must be deployed and key business flows should continue working.

Would you like me to review and fix this vulnerability in your PrestaShop store? I can inspect your versions and modules, assess exposure, apply the appropriate security changes and regression-test key workflows. Get in touch and we can handle it calmly, without unnecessary alarm.

Editorial note: this article summarizes publicly available information and does not prove your shop was exploited. Whenever a patched version could not be verified, that limitation is explicitly stated.

// Fontes

  1. CVE record — CVE-2021-3110 cve.org ↗
  2. PrestaShield — PrestaShop vulnerability database prestashield.com ↗

// ++ — related