CVE-2018-20676: twbs Bootstrap XSS in tooltip data-viewport attribute

CVE-2018-20676 · Severity: low · CVSS 3 · Published 2019-01-17

Bootstrap, a widely used web development framework, contains a security flaw in how it handles tooltips. An attacker could use this to run malicious scripts in a user's browser if they interact with a specially crafted part of a website. This could lead to unauthorized actions being performed on behalf of the user or the theft of sensitive session information.

Technologies: org.webjars:bootstrap (Maven), bootstrap (npm), bootstrap-sass (npm), twbs/bootstrap (Packagist). Vendors: Maven, npm, Packagist.

Quick answers

Is CVE-2018-20676 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2018-20676 being exploited in the wild.
How severe is CVE-2018-20676?
Low severity, with a CVSS score of 3, published 17 January 2019.
Which products and versions are affected?
org.webjars:bootstrap (Maven) ECOSYSTEM:introduced=0,fixed=3.4.0; bootstrap (npm) SEMVER:introduced=0,fixed=3.4.0; bootstrap-sass (npm) SEMVER:introduced=0,fixed=3.4.0; twbs/bootstrap (Packagist) ECOSYSTEM:introduced=0,fixed=3.4.0.
Is there a fix for CVE-2018-20676?
Yes. org.webjars:bootstrap (Maven): upgrade to 3.4.0 or later; bootstrap (npm): upgrade to 3.4.0 or later; bootstrap-sass (npm): upgrade to 3.4.0 or later; twbs/bootstrap (Packagist): upgrade to 3.4.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2018-20676 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2018-20676?
Check whether you run org.webjars:bootstrap (Maven), bootstrap (npm), bootstrap-sass (npm) or one of the others listed 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

  • org.webjars:bootstrap (Maven): upgrade to 3.4.0 or later
    # set org.webjars:bootstrap to 3.4.0 in your pom.xml or build.gradle
  • bootstrap (npm): upgrade to 3.4.0 or later
    npm install bootstrap@3.4.0
  • bootstrap-sass (npm): upgrade to 3.4.0 or later
    npm install bootstrap-sass@3.4.0
  • twbs/bootstrap (Packagist): upgrade to 3.4.0 or later
    composer require twbs/bootstrap:^3.4.0

Technical details

A Cross-Site Scripting (XSS) vulnerability exists in Bootstrap versions prior to 3.4.0. The flaw is located in the tooltip component's handling of the 'data-viewport' attribute, which fails to properly sanitize input before rendering it in the DOM. An attacker can exploit this by injecting a malicious script into the attribute (e.g., via an <img> tag with an 'onerror' handler). Execution occurs when a user interacts with the affected element, such as hovering over a link that triggers the tooltip. This is a client-side vulnerability requiring user interaction. The issue was resolved in version 3.4.0 by implementing proper input neutralization.

Affected products

  • twbs bootstrap < 3.4.0
  • twbs bootstrap-sass < 3.4.0

Identifiers

  • CVE-2018-20676
  • GHSA-3mgp-fx93-9xv5

Timeline

  • 2018-08-10: disclosed: Issue reported on GitHub repository
  • 2018-12-13: patched: Bootstrap 3.4.0 released with fix
  • 2019-01-17: advisory: GitHub advisory published

References

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