# CVE-2018-20677: Bootstrap cross-site scripting in affix configuration

Source: https://junglewise.ai/threats/cve-2018-20677-bootstrap-cross-site-scripting-in-affix-configuration  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2019-01-17. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

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

Bootstrap is a widely-used front-end framework for building web applications and responsive websites. A cross-site scripting (XSS) vulnerability in the affix component's target property could allow attackers to inject malicious code that executes in users' browsers, potentially leading to session hijacking, credential theft, or defacement. This affects all versions of Bootstrap prior to 3.4.0.

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-20677 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2018-20677 being exploited in the wild.

**How severe is CVE-2018-20677?** 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-20677?** 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-20677 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2018-20677?** 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

This is a stored cross-site scripting (XSS) vulnerability (CWE-79) in Bootstrap's affix component, specifically in how it handles the target configuration property. The vulnerability exists because user-supplied or untrusted input passed to the affix target property is not properly sanitized before being used in DOM manipulation operations. An attacker can craft malicious input containing JavaScript code that will be executed when the affix component processes the target property, without requiring authentication. The fix was implemented in Bootstrap 3.4.0 and later versions.

## Affected products

- Bootstrap Bootstrap before 3.4.0
- Bootstrap bootstrap-sass before 3.4.0

## Identifiers

- CVE-2018-20677
- GHSA-ph58-4vrj-w6hr

## Timeline

- 2019-01-17: disclosed
- 2018-12-13: patched: Bootstrap 3.4.0 released

## References

- [https://github.com/twbs/bootstrap/issues/27915](https://github.com/twbs/bootstrap/issues/27915)

## 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)
