Bootstrap XSS in tooltip and popover data-template attribute

Severity: info · Published 2019-02-22

Bootstrap is a popular front-end framework used to build responsive websites and web applications. This vulnerability allows attackers to inject malicious scripts through the tooltip or popover data-template attribute, potentially compromising user sessions or stealing sensitive data displayed on affected web pages.

Technologies: bootstrap (npm), bootstrap-sass (npm). Vendors: npm.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Informational severity, published 22 February 2019.
Which products and versions are affected?
bootstrap (npm) SEMVER:introduced=3.0.0,fixed=3.4.1,introduced=4.0.0,fixed=4.3.1; bootstrap-sass (npm) SEMVER:introduced=3.0.0,fixed=3.4.1.
Is there a fix for This vulnerability?
Yes. bootstrap (npm): upgrade to 4.3.1 or later; bootstrap-sass (npm): upgrade to 3.4.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network.
Am I affected?
Check whether you run bootstrap (npm) or bootstrap-sass (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • bootstrap (npm): upgrade to 4.3.1 or later
    npm install bootstrap@4.3.1
  • bootstrap-sass (npm): upgrade to 3.4.1 or later
    npm install bootstrap-sass@3.4.1

Technical details

This is a cross-site scripting (XSS) vulnerability in Bootstrap 3 before version 3.4.1 and Bootstrap 4 before version 4.3.1. The vulnerability exists in the tooltip and popover components, which fail to properly sanitize the data-template attribute, allowing an attacker to inject arbitrary JavaScript code. The attack requires an application to use tooltips or popovers with user-controlled or unsanitized template data. An attacker can exploit this to execute arbitrary scripts in the context of a user's browser, potentially leading to session hijacking, credential theft, or malware distribution. Patches are available in Bootstrap 3.4.1 and 4.3.1.

Affected products

  • Bootstrap Bootstrap 3.0.0 to 3.4.0, 4.0.0 to 4.3.0
  • Bootstrap bootstrap-sass 3.0.0 to 3.4.0

Timeline

  • 2019-02-22: disclosed
  • 2019-02-13: patched: Bootstrap 4.3.1 and 3.4.1 released
  • 2023-03-14: other: Advisory withdrawn from GitHub Advisory Database

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.