CVE-2018-19994: Dolibarr SQL Injection Vulnerability in product/card.php
Summary
CVE-2018-19994: Dolibarr error-based SQL injection vulnerability in product/card.php. Affects dolibarr/dolibarr versions < 8.0.4. Fixed in 8.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 is an open-source ERP and CRM software designed for small and medium-sized businesses. It offers a wide range of features, including inventory management, invoicing, project management, and more. Dolibarr is written in PHP and is available on Packagist. However, a vulnerability has been discovered in the product/card.php file of Dolibarr version 8.0.2.
Vulnerability Detail
The vulnerability, identified as CVE-2018-19994, is an error-based SQL injection vulnerability. It affects the desiredstock parameter in the product/card.php file. Remote authenticated users can exploit this vulnerability to execute arbitrary SQL commands. This can lead to unauthorized access, data manipulation, or even complete compromise of the affected system. The severity of this vulnerability is rated as HIGH with a CVSS score of 8.8.
How To Fix
Minimum fixed version
8.0.4
This is the first release that contains the fix.
composer require dolibarr/dolibarr:8.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 possible, a temporary workaround can be implemented by sanitizing and validating user input for the desiredstock parameter in the product/card.php file. This can be done by using proper input validation techniques, such as parameterized queries or prepared statements, to prevent SQL injection attacks. Here is an example of how to implement parameterized queries in PHP:
$desiredStock = $_POST['desiredstock'];
$stmt = $pdo->prepare('SELECT * FROM products WHERE desiredstock = :desiredStock');
$stmt->bindParam(':desiredStock', $desiredStock);
$stmt->execute();
$results = $stmt->fetchAll();
Conclusion
The SQL injection vulnerability in Dolibarr's product/card.php file (CVE-2018-19994) can be mitigated by upgrading to version 8.0.4 or later. If immediate upgrade is not possible, implementing proper input validation techniques can serve as a temporary workaround. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for dolibarr/dolibarr →
FAQ
Dolibarr is an open-source ERP and CRM software designed for small and medium-sized businesses. It offers various features, including inventory management, invoicing, project management, and more.
The vulnerability allows remote authenticated users to execute arbitrary SQL commands, potentially leading to unauthorized access, data manipulation, or compromise of the affected system.
To fix this vulnerability, it is recommended to upgrade Dolibarr to version 8.0.4 or later. This will patch the SQL injection issue in the product/card.php file.
If immediate upgrade is not possible, you can implement a temporary workaround by sanitizing and validating user input for the desiredstock parameter in the product/card.php file. This can be done using proper input validation techniques, such as parameterized queries or prepared statements.
You can find more information about this vulnerability, including its CVE identifier, on the Vulert website (https://vulert.com). Vulert provides real-time monitoring and alerts for open-source vulnerabilities, helping you stay informed and secure.
References
Related vulnerabilities
Recent vulnerabilities recorded for dolibarr/dolibarr.