CVE-2018-19993: Dolibarr reflected cross-site scripting (XSS) vulnerability
Summary
CVE-2018-19993: Dolibarr reflected cross-site scripting (XSS) vulnerability. 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 provides various features such as accounting, inventory management, project management, and customer relationship management. The vulnerability in Dolibarr version 8.0.2 allows remote attackers to inject arbitrary web script or HTML through the transphrase parameter in the public/notice.php file.
Vulnerability Detail
The vulnerability in Dolibarr version 8.0.2 is a reflected cross-site scripting (XSS) vulnerability. This type of vulnerability occurs when user-supplied data is not properly validated or sanitized before being included in a web page. In this case, the transphrase parameter in the public/notice.php file is vulnerable to XSS attacks. An attacker can exploit this vulnerability by injecting malicious script or HTML code, which will be executed in the context of the victim's browser. This can lead to various consequences, including session hijacking, defacement of the website, or theft of sensitive information.
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 is to disable the affected functionality or implement input validation and sanitization measures to mitigate the risk of XSS attacks. Here is an example of how to sanitize the transphrase parameter in PHP:
$transphrase = htmlspecialchars($_GET['transphrase'], ENT_QUOTES, 'UTF-8');
This code snippet uses the htmlspecialchars function to convert special characters to their HTML entities, preventing them from being interpreted as HTML or script code.
Conclusion
The reflected cross-site scripting (XSS) vulnerability in Dolibarr version 8.0.2 can be exploited by remote attackers to inject malicious script or HTML code. To mitigate this vulnerability, it is recommended to upgrade Dolibarr to version 8.0.4 or later. If immediate upgrade is not possible, implementing input validation and sanitization measures can provide temporary protection. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for dolibarr/dolibarr →
FAQ
A reflected cross-site scripting (XSS) vulnerability occurs when user-supplied data is not properly validated or sanitized before being included in a web page. Attackers can exploit this vulnerability by injecting malicious script or HTML code, which is then executed in the context of the victim's browser.
The consequences of this vulnerability can vary, but they may include session hijacking, defacement of the website, or theft of sensitive information. Attackers can use XSS attacks to steal user credentials, inject malicious content, or perform other malicious actions.
To protect your Dolibarr installation, it is recommended to upgrade to version 8.0.4 or later. Additionally, you should always validate and sanitize user-supplied data before including it in a web page. Implementing input validation and sanitization measures can help mitigate the risk of XSS attacks.
If upgrading to the latest version is not immediately possible, you can disable the affected functionality or implement input validation and sanitization measures. The provided code snippet demonstrates how to sanitize the transphrase parameter in PHP.
For more information about this vulnerability, you can refer to the GitHub Security Advisory GHSA-2gc5-3h3p-8vpf or the associated CVE identifier CVE-2018-19993.
References
Related vulnerabilities
Recent vulnerabilities recorded for dolibarr/dolibarr.