CVE-2024-6484: Bootstrap Cross-Site Scripting (XSS) Vulnerability
Summary
CVE-2024-6484: Bootstrap Cross-Site Scripting (XSS) vulnerability. Affects bootstrap versions >= 2.0.0, <= 3.4.1. No fix is published. How to fix ↓
Also tracked for
- twitter-bootstrap3 · Debian:11
The same CVE-2024-6484 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 is a popular open-source framework used for building responsive and mobile-first websites. It provides a collection of CSS and JavaScript components that simplify the process of web development. The vulnerability identified in Bootstrap affects the carousel component, specifically the data-slide and data-slide-to attributes. Due to inadequate sanitization, an attacker can exploit these attributes through the href attribute of an <a> tag, leading to a Cross-Site Scripting (XSS) attack. This vulnerability allows attackers to execute arbitrary JavaScript code within a victim's browser, potentially compromising their sensitive information and enabling further attacks.
Vulnerability Detail
The vulnerability in Bootstrap arises from the lack of proper sanitization of user input in the carousel component. By manipulating the data-slide and data-slide-to attributes through the href attribute of an <a> tag, an attacker can inject malicious JavaScript code. When a user interacts with the compromised carousel, the injected code executes within their browser, giving the attacker control over the victim's session and potentially exposing their sensitive data. This vulnerability affects versions 2.0.0 to 3.4.1 of the Bootstrap package.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
If updating the Bootstrap package is not immediately feasible, developers can implement a workaround by manually sanitizing the user input before using it in the carousel component. This can be achieved by using a library or framework that provides robust input sanitization functions. Here's an example of how to sanitize the input in JavaScript:
const sanitizedInput = DOMPurify.sanitize(userInput);
Conclusion
The Cross-Site Scripting (XSS) vulnerability in Bootstrap's carousel component allows attackers to execute arbitrary JavaScript code within a victim's browser. This can lead to the compromise of sensitive information and enable further attacks. Developers should update their Bootstrap package to a version beyond 3.4.1 or implement manual input sanitization as a workaround. Regularly monitoring for vulnerabilities using tools like Vulert can help ensure the security of your software.
See every vulnerability recorded for bootstrap →
FAQ
The vulnerability allows attackers to execute arbitrary JavaScript code within a victim's browser, potentially compromising their sensitive information and enabling further attacks.
Versions 2.0.0 to 3.4.1 of the Bootstrap package are affected by this vulnerability.
Developers should update their Bootstrap package to a version beyond 3.4.1 that includes the necessary security patches.
If updating the Bootstrap package is not immediately feasible, developers can manually sanitize user input before using it in the carousel component.
Yes, the CVSS score for this vulnerability is 6.4.
References
Related vulnerabilities
Recent vulnerabilities recorded for bootstrap.