CVE-2018-13448: Dolibarr ERP/CRM SQL Injection Vulnerability in product/card.php
Summary
CVE-2018-13448: 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 for managing various business processes, including sales, inventory, invoicing, and more. Dolibarr version 7.0.3 is affected by a critical SQL injection vulnerability in the product/card.php file.
Vulnerability Detail
The SQL injection vulnerability in Dolibarr ERP/CRM version 7.0.3 exists in the product/card.php file. Attackers can exploit this vulnerability by manipulating the country_id parameter to execute arbitrary SQL commands. This can lead to unauthorized access, data leakage, data manipulation, and potentially complete compromise of the affected system.
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 immediately is not possible, users can apply a temporary workaround by modifying the affected file (product/card.php) to sanitize and validate user input before executing SQL queries. Here is an example of how to implement input validation and parameter binding using PDO in PHP:
// Retrieve the country_id parameter
$countryId = $_GET['country_id'];
// Sanitize and validate the input
$countryId = filter_var($countryId, FILTER_VALIDATE_INT);
// Prepare and execute the SQL query using parameter binding
$stmt = $pdo->prepare('SELECT * FROM products WHERE country_id = :countryId');
$stmt->bindParam(':countryId', $countryId, PDO::PARAM_INT);
$stmt->execute();
// Fetch the results
$results = $stmt->fetchAll();
// Process the results
foreach ($results as $row) {
// Process each row
}
Note: This is a temporary workaround and should not be considered a long-term solution. Upgrading to the latest version is still strongly recommended.
Conclusion
The SQL injection vulnerability in Dolibarr ERP/CRM version 7.0.3 can have severe consequences, including unauthorized access, data leakage, and potential compromise of the affected system. It is crucial to upgrade to the latest version (7.0.4 or later) to mitigate this vulnerability. If immediate upgrade is not possible, applying the provided workaround can help temporarily protect the system. For further support and assistance 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 for managing various business processes, including sales, inventory, invoicing, and more.
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 leakage, data manipulation, and potentially complete compromise of the affected system.
To fix this vulnerability, it is recommended to upgrade Dolibarr ERP/CRM to version 7.0.4 or later. The upgrade includes a patch that addresses the SQL injection vulnerability in product/card.php. Users should ensure they are running the latest version of Dolibarr and follow the upgrade instructions provided by the project.
If upgrading immediately is not possible, users can apply a temporary workaround by modifying the affected file (product/card.php) to sanitize and validate user input before executing SQL queries. However, this should not be considered a long-term solution, and upgrading to the latest version is still strongly recommended.
For more information about this vulnerability, you can refer to the Dolibarr ERP/CRM advisory on the GitHub Advisory Database: https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/05/GHSA-m5rg-g6f9-8wpw/GHSA-m5rg-g6f9-8wpw.json
References
Related vulnerabilities
Recent vulnerabilities recorded for dolibarr/dolibarr.