CVE-2018-13447: Dolibarr ERP/CRM SQL Injection Vulnerability in product/card.php
Summary
CVE-2018-13447: Dolibarr SQL injection vulnerability in product/card.php. Affects dolibarr/dolibarr versions >= 7.0.3, < 7.0.4. Fixed in 7.0.4. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Dolibarr ERP/CRM is an open-source software package that provides enterprise resource planning (ERP) and customer relationship management (CRM) functionalities. It is widely used by businesses to manage various aspects of their operations, including sales, inventory, and customer interactions. The vulnerability identified in the product/card.php file of Dolibarr version 7.0.3 allows remote attackers to execute arbitrary SQL commands by exploiting the statut parameter.
Vulnerability Detail
The SQL injection vulnerability in Dolibarr ERP/CRM version 7.0.3 arises from inadequate input validation in the product/card.php file. By manipulating the statut parameter, an attacker can inject malicious SQL commands into the application's database queries. This can lead to unauthorized access, data manipulation, or even complete compromise of the system. The severity of this vulnerability is rated as CRITICAL with a CVSS score of 9.8.
How To Fix
Minimum fixed version
7.0.4
This is the first release that contains the fix.
composer require dolibarr/dolibarr:7.0.4
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading to the latest version is not immediately feasible, users can apply a temporary workaround by modifying the product/card.php file. It is crucial to implement proper input validation and sanitization techniques to prevent SQL injection attacks. Here is an example of how to mitigate the vulnerability by using prepared statements in PHP:
// Original vulnerable code
$statut = $_GET['statut'];
$query = "SELECT * FROM products WHERE statut = '" . $statut . "'";
$result = $db->query($query);
// Mitigated code using prepared statements
$statut = $_GET['statut'];
$query = "SELECT * FROM products WHERE statut = ?";
$stmt = $db->prepare($query);
$stmt->bind_param("s", $statut);
$stmt->execute();
$result = $stmt->get_result();
By using prepared statements, the input is automatically sanitized, preventing SQL injection attacks.
Conclusion
The SQL injection vulnerability in Dolibarr ERP/CRM version 7.0.3 can be mitigated by upgrading to version 7.0.4 or later. Users can also apply a temporary workaround by implementing proper input validation and sanitization techniques. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for dolibarr/dolibarr →
FAQ
Dolibarr ERP/CRM is an open-source software package that provides enterprise resource planning (ERP) and customer relationship management (CRM) functionalities. It is widely used by businesses to manage various aspects of their operations, including sales, inventory, and customer interactions.
A SQL injection vulnerability occurs when an application does not properly validate or sanitize user-supplied input before using it in SQL queries. This allows an attacker to manipulate the input and execute arbitrary SQL commands, potentially compromising the security and integrity of the application's database.
The SQL injection vulnerability in Dolibarr ERP/CRM version 7.0.3 allows remote attackers to execute arbitrary SQL commands. This can lead to unauthorized access, data manipulation, or even complete compromise of the system.
To fix this vulnerability, it is recommended to upgrade Dolibarr ERP/CRM to version 7.0.4 or later. The developers have addressed the issue by implementing proper input validation and sanitization techniques in the product/card.php file.
If upgrading to the latest version is not immediately feasible, users can apply a temporary workaround by modifying the product/card.php file. It is crucial to implement proper input validation and sanitization techniques to prevent SQL injection attacks.
References
Related vulnerabilities
Recent vulnerabilities recorded for dolibarr/dolibarr.