CVE-2026-141468: Bootstrap: the Toggler plugin turns sanitizer-approved `data-*` attributes into an executable inline event handler
Bootstrap is the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first projects on the web. From version 6.0.0-alpha.1 until 6.0.0-alpha.2, the Bootstrap 6 Toggler plugin accepts an attacker-controlled attribute name in data-bs-attribute and value in data-bs-value, which an application may preserve while sanitizing untrusted rich HTML with DOMPurify's default configuration. In js/src/toggler.ts, Toggler.execute() rejects only id and otherwise passes the name and value to setAttribute(), allowing a value such as an inline event handler to become executable after the victim clicks a [data-bs-toggle="toggler"] control. On a page without a Content Security Policy that blocks inline handlers, this can execute JavaScript in the application's origin and permit access to origin data, authenticated same-origin actions, and page modification. Bootstrap 5 is unaffected because it does not contain the Toggler plugin. This issue is fixed in version 6.0.0-alpha.2.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 6.0.0-alpha.2
Event History
Frequently Asked Questions
Which deployments are affected?
Affected deployments use Bootstrap 6 from 6.0.0-alpha.1 through versions before 6.0.0-alpha.2 and include the Toggler plugin. Bootstrap 5 is not affected because it does not contain that plugin.
What conditions are required for exploitation?
An attacker must be able to get crafted data-bs-attribute and data-bs-value attributes preserved in page content, such as untrusted rich HTML sanitized with DOMPurify's default configuration. A victim must then click a control using data-bs-toggle="toggler".
Does a Content Security Policy reduce the impact?
Yes. Exploitation depends on the page lacking a Content Security Policy that blocks inline event handlers; a policy that blocks them prevents the generated inline handler from executing.
What should teams do if they cannot patch immediately?
Avoid allowing untrusted content to retain attacker-controlled data-bs-attribute and data-bs-value attributes, particularly where it can interact with Toggler controls. Enforce a Content Security Policy that blocks inline event handlers where feasible.
How can an application determine whether it is exposed?
Check whether it uses the Bootstrap 6 Toggler plugin and a version from 6.0.0-alpha.1 before 6.0.0-alpha.2. Also review whether untrusted sanitized HTML can retain the relevant data attributes and be rendered on pages with Toggler controls.