CVE-2022-1726: Cross-site Scripting in bootstrap-table
Summary
CVE-2022-1726: Cross-site Scripting in bootstrap-table. Affects bootstrap-table versions < 1.20.2. Fixed in 1.20.2. How to fix ↓
Also tracked for
- zoneminder · Debian:11
The same CVE-2022-1726 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
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
Bootstrap-table is an open-source JavaScript library that provides a feature-rich and customizable table plugin for displaying data in web applications. It is commonly used to enhance the functionality and appearance of tables. However, prior to version 1.20.2, bootstrap-table is vulnerable to a cross-site scripting (XSS) attack when using the Table Export plugin with the exportOptions set to htmlContent. This vulnerability can lead to the disclosure of session cookies, secure session data, and the exfiltration of data to third parties.
Vulnerability Detail
The XSS vulnerability in bootstrap-table arises from the Table Export plugin's exportOptions parameter. When the exportOptions are set to htmlContent, an attacker can inject malicious scripts into the exported table, which will be executed when viewed by a victim. This can lead to various security risks, including the theft of sensitive information, session hijacking, and unauthorized access to user accounts. The vulnerability has a CVSS score of 6.8, indicating a moderate severity level.
How To Fix
Minimum fixed version
1.20.2
This is the first release that contains the fix.
npm install bootstrap-table@1.20.2
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, a temporary workaround is to disable the Table Export plugin or set the exportOptions to exclude htmlContent. This can be achieved by modifying the configuration of the bootstrap-table plugin in the application code. Here is an example of how to disable the Table Export plugin:
$('#table').bootstrapTable({
showExport: false
});
Conclusion
In conclusion, the bootstrap-table library prior to version 1.20.2 is vulnerable to cross-site scripting (XSS) attacks when using the Table Export plugin with htmlContent enabled. This can result in the disclosure of sensitive information and the potential compromise of user accounts. It is crucial to upgrade to the latest secure version or apply the recommended workarounds to mitigate this vulnerability. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for bootstrap-table →
FAQ
Bootstrap-table is a JavaScript library that provides a feature-rich and customizable table plugin for displaying data in web applications. It offers various functionalities, such as sorting, filtering, pagination, and exporting data.
The Table Export plugin is an extension of bootstrap-table that allows users to export table data in various formats, such as CSV, Excel, and PDF.
The XSS vulnerability in bootstrap-table occurs when the Table Export plugin's exportOptions parameter is set to htmlContent. This allows an attacker to inject malicious scripts into the exported table, which are executed when viewed by a victim.
The potential risks of this vulnerability include the disclosure of session cookies, secure session data, and the exfiltration of data to third parties. It can also lead to session hijacking, unauthorized access to user accounts, and the theft of sensitive information.
To mitigate this vulnerability, it is recommended to upgrade bootstrap-table to version 1.20.2 or later. Alternatively, you can disable the Table Export plugin or set the exportOptions to exclude htmlContent in the application code.
Related vulnerabilities
Recent vulnerabilities recorded for bootstrap-table.