CVE-2024-6485 Overview
A Cross-Site Scripting (XSS) vulnerability has been discovered in Bootstrap that affects the button plugin's data-loading-text attribute. This vulnerability allows attackers to inject malicious JavaScript code into the attribute, which is then executed when the button's loading state is triggered. The flaw stems from improper sanitization of user-controlled input within the Bootstrap framework's button component.
Critical Impact
Attackers can execute arbitrary JavaScript in the context of a user's browser session, potentially leading to session hijacking, credential theft, or malicious actions performed on behalf of authenticated users.
Affected Products
- Bootstrap (versions using the legacy button plugin with data-loading-text attribute)
- Debian LTS distributions using vulnerable Bootstrap packages
- Web applications utilizing affected Bootstrap button components
Discovery Timeline
- 2024-07-11 - CVE-2024-6485 published to NVD
- 2025-11-03 - Last updated in NVD database
Technical Details for CVE-2024-6485
Vulnerability Analysis
This vulnerability is classified as Cross-Site Scripting (CWE-79), specifically affecting the Bootstrap button plugin's handling of the data-loading-text attribute. When a button component transitions to its loading state, the framework processes the data-loading-text attribute value to display loading text to users. However, the attribute content is not properly sanitized before being rendered into the DOM.
The attack requires user interaction (clicking the button to trigger the loading state) and network access to deliver the malicious payload. While the attack complexity is high due to the specific conditions required for exploitation, successful attacks can result in significant confidentiality impact through session token theft and moderate integrity and availability impacts.
Root Cause
The root cause lies in insufficient input validation and output encoding within Bootstrap's button plugin. The data-loading-text attribute value is inserted into the DOM without proper HTML entity encoding or JavaScript escaping. This allows specially crafted attribute values containing script tags or JavaScript event handlers to be interpreted as executable code rather than plain text.
Attack Vector
The attack is network-based and requires an attacker to either:
- Inject malicious content into a page where Bootstrap buttons use dynamically generated data-loading-text values from user-controlled sources
- Convince a user to interact with a specially crafted page containing a Bootstrap button with a malicious data-loading-text attribute
When the button's loading state is triggered (typically through user click interaction), the malicious JavaScript payload embedded in the attribute executes within the victim's browser context. This can be leveraged to steal session cookies, perform actions on behalf of the user, or redirect users to phishing pages.
The vulnerability mechanism involves Bootstrap reading the data-loading-text attribute and inserting its contents directly into the button element's HTML when the loading state activates. Without proper sanitization, payloads such as script tags or event handlers embedded in this attribute will execute. For detailed technical analysis, refer to the HeroDev CVE-2024-6485 Detail.
Detection Methods for CVE-2024-6485
Indicators of Compromise
- Unusual JavaScript execution patterns originating from Bootstrap button elements
- Web application logs showing suspicious data-loading-text attribute values containing script tags, event handlers, or encoded JavaScript
- Client-side security tools detecting inline script execution from button elements
Detection Strategies
- Implement Content Security Policy (CSP) headers with strict script-src directives to detect and block inline script execution
- Deploy web application firewall (WAF) rules to identify XSS payloads in HTTP requests targeting Bootstrap button attributes
- Use browser developer tools or security scanners to audit data-loading-text attributes for suspicious content
- Monitor for DOM manipulation patterns consistent with XSS exploitation
Monitoring Recommendations
- Enable client-side JavaScript error logging to capture potential XSS attack attempts
- Configure SentinelOne Singularity to monitor for anomalous script execution in web browser contexts
- Implement server-side logging of all user-supplied input that may populate Bootstrap button attributes
- Regularly scan web applications for XSS vulnerabilities using automated security testing tools
How to Mitigate CVE-2024-6485
Immediate Actions Required
- Audit all Bootstrap implementations in your environment to identify usage of the data-loading-text attribute
- Implement strict input validation and output encoding for any user-controlled data that populates Bootstrap button attributes
- Deploy Content Security Policy headers to restrict inline script execution as a defense-in-depth measure
- Consider removing or replacing the vulnerable button plugin functionality if not essential to application operation
Patch Information
Organizations using Debian LTS should review the Debian LTS Announcement for patched package availability. For other distributions and direct Bootstrap usage, consult the HeroDev vulnerability directory for the latest remediation guidance and patch information.
Workarounds
- Sanitize all user input before it reaches the data-loading-text attribute by encoding HTML special characters
- Replace usage of data-loading-text with safer alternatives that do not execute dynamic content
- Implement strict CSP headers with script-src 'self' to prevent inline script execution
- Use a JavaScript sanitization library to cleanse any dynamic content before DOM insertion
# Example CSP header configuration for Apache
# Add to .htaccess or Apache configuration
Header set Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'"
# Example CSP header configuration for Nginx
# Add to nginx.conf server block
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'";
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


