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

Source: https://junglewise.ai/threats/cve-2018-20676-twbs-bootstrap-xss-in-tooltip-data-viewport-attribute  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2019-01-17. Updated: 2026-05-14  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/org-webjars-bootstrap), [bootstrap (npm)](https://junglewise.ai/threats/technologies/bootstrap), [bootstrap-sass (npm)](https://junglewise.ai/threats/technologies/bootstrap-sass), [twbs/bootstrap (Packagist)](https://junglewise.ai/threats/technologies/twbs-bootstrap). Vendors: [Maven](https://junglewise.ai/threats/vendors/maven), [npm](https://junglewise.ai/threats/vendors/npm), [Packagist](https://junglewise.ai/threats/vendors/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

  ```sh
  # set org.webjars:bootstrap to 3.4.0 in your pom.xml or build.gradle
  ```

- bootstrap (npm): upgrade to 3.4.0 or later

  ```sh
  npm install bootstrap@3.4.0
  ```

- bootstrap-sass (npm): upgrade to 3.4.0 or later

  ```sh
  npm install bootstrap-sass@3.4.0
  ```

- twbs/bootstrap (Packagist): upgrade to 3.4.0 or later

  ```sh
  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

- [https://github.com/twbs/bootstrap/issues/27915](https://github.com/twbs/bootstrap/issues/27915)
- [https://github.com/twbs/bootstrap/issues/27915](https://github.com/twbs/bootstrap/issues/27915)
- [https://github.com/twbs/bootstrap/issues/27044](https://github.com/twbs/bootstrap/issues/27044)
- [https://github.com/twbs/bootstrap/pull/27047](https://github.com/twbs/bootstrap/pull/27047)
- [https://github.com/twbs/bootstrap/commit/2a5ba23ce8f041f3548317acc992ed8a736b609d](https://github.com/twbs/bootstrap/commit/2a5ba23ce8f041f3548317acc992ed8a736b609d)
- [https://lists.apache.org/thread.html/rd0e44e8ef71eeaaa3cf3d1b8b41eb25894372e2995ec908ce7624d26@%3Ccommits.pulsar.apache.org%3E](https://lists.apache.org/thread.html/rd0e44e8ef71eeaaa3cf3d1b8b41eb25894372e2995ec908ce7624d26@%3Ccommits.pulsar.apache.org%3E)

## Related threats

- [Bootstrap Vulnerable to Cross-Site Scripting in its Popover and Tooltip Components](https://junglewise.ai/threats/cve-2025-1647-bootstrap-cross-site-scripting-in-popover-and-tooltip)
- [Bootstrap XSS vulnerability in carousel component](https://junglewise.ai/threats/cve-2024-6531-bootstrap-xss-vulnerability-in-carousel-component)
- [Bootstrap XSS vulnerability in carousel component (withdrawn)](https://junglewise.ai/threats/cve-2024-6484-bootstrap-xss-vulnerability-in-carousel-component-withdrawn)
- [Bootstrap Cross-Site Scripting in data-* attributes](https://junglewise.ai/threats/cve-2024-6485-bootstrap-cross-site-scripting-in-data-attributes)
- [Bootstrap XSS in tooltip and popover plugins](https://junglewise.ai/threats/cve-2019-8331-bootstrap-xss-in-tooltip-and-popover-plugins)
