CVE-2018-14040 — Vulnerability in bootstrap — CVE Details
Bootstrap vulnerable to Cross-Site Scripting (XSS)
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (4.07%). Schedule for your next planned update.
Does your project use an affected bootstrap version?
Paste your packages.lock.json to check it for CVE-2018-14040 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
In Bootstrap starting in version 2.3.0 and prior to 3.4.0, as well as 4.x before 4.1.2, XSS is possible in the collapse data-parent attribute.
Advisory Timeline
- First published May 13, 2022 (1658 days ago).
- Last revised September 10, 2026 — 1581 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
dotnet add package bootstrap --version 3.4.0
<!-- Update pom.xml dependency version to 3.4.0 for org.webjars:bootstrap -->
dotnet add package bootstrap.sass --version 4.1.2
composer require "twbs/bootstrap:^4.1.2"
gem install bootstrap -v 3.4.0
dotnet add package bootstrap --version 4.1.2
npm install bootstrap@4.1.2
gem install bootstrap-sass -v 3.4.0
gem install bootstrap -v 4.1.2
npm install bootstrap@3.4.0
composer require "twbs/bootstrap:^3.4.0"
<!-- Update pom.xml dependency version to 4.1.2 for org.webjars:bootstrap -->
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (12)
Affects 5 ecosystems: NuGet (2), RubyGems (2), Maven (1), npm (1), Packagist (1).
| Package | Fixed In |
|---|---|
| bootstrap NuGet · Affected: 2.3.1, 2.3.2, 3.0.0, 3.0.1 (+14 more) | 3.4.0 |
| org.webjars:bootstrap Maven · Affected: 2.3.0, 2.3.1, 2.3.1-1, 2.3.2 (+23 more) | 3.4.0 |
| bootstrap.sass NuGet · Affected: 4.0.0, 4.1.0, 4.1.1, 4.1.1-contentFiles | 4.1.2 |
| twbs/bootstrap Packagist · Affected: v4.0.0, v4.1.0, v4.1.1 | 4.1.2 |
| bootstrap RubyGems · Affected: All versions | 3.4.0 |
| bootstrap NuGet · Affected: 4.0.0, 4.1.0, 4.1.1, 4.1.1-contentFiles | 4.1.2 |
| bootstrap npm · Affected: All versions | 4.1.2 |
| bootstrap-sass RubyGems · Affected: 2.3.0.0, 2.3.0.1, 2.3.1.0, 2.3.1.2 (+29 more) | 3.4.0 |
| bootstrap RubyGems · Affected: 4.0.0, 4.1.0, 4.1.1 | 4.1.2 |
| bootstrap npm · Affected: All versions | 3.4.0 |
| twbs/bootstrap Packagist · Affected: v2.3.0, v2.3.1, v2.3.2, v3.0.0 (+15 more) | 3.4.0 |
| org.webjars:bootstrap Maven · Affected: 4.0.0, 4.0.0-1, 4.0.0-2, 4.1.0 (+1 more) | 4.1.2 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-79Cross-site Scripting (XSS)MITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 6.1 score means for each attack dimension.
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
References
- https://nvd.nist.gov/vuln/detail/CVE-2018-14040ADVISORY
- https://github.com/twbs/bootstrap/issues/26423WEB
- https://github.com/twbs/bootstrap/issues/26625WEB
- https://github.com/twbs/bootstrap/pull/26630WEB
- https://github.com/twbs/bootstrap-rubygem/commit/f34c43c936ac7d0ebb129289321d8c51cd56aed1#diff-4e736e880b7fc39eb5e85576b629f6e3cd08f02f45104a7b4581f82852e97a81R1306WEB
- https://github.com/twbs/bootstrap/commit/149096016f70fd815540d62c0989fd99cdc809e0WEB
- https://github.com/twbs/bootstrap/commit/2a5ba23ce8f041f3548317acc992ed8a736b609dWEB
- https://www.tenable.com/security/tns-2021-14WEB
- https://www.oracle.com/security-alerts/cpuApr2021.htmlWEB
- https://seclists.org/bugtraq/2019/May/18WEB
- https://lists.debian.org/debian-lts-announce/2018/08/msg00027.htmlWEB
- https://lists.apache.org/thread.html/rd0e44e8ef71eeaaa3cf3d1b8b41eb25894372e2995ec908ce7624d26@%3Ccommits.pulsar.apache.org%3EWEB
- https://lists.apache.org/thread.html/r3dc0cac8d856bca02bd6997355d7ff83027dcfc82f8646a29b89b714@%3Cissues.hbase.apache.org%3EWEB
- https://lists.apache.org/thread.html/f9bc3e55f4e28d1dcd1a69aae6d53e609a758e34d2869b4d798e13cc@%3Cissues.drill.apache.org%3EWEB
- https://lists.apache.org/thread.html/b0656d359c7d40ec9f39c8cc61bca66802ef9a2a12ee199f5b0c1442@%3Cdev.drill.apache.org%3EWEB
- https://lists.apache.org/thread.html/52e0e6b5df827ee7f1e68f7cc3babe61af3b2160f5d74a85469b7b0e@%3Cdev.superset.apache.org%3EWEB
- https://lists.apache.org/thread.html/519eb0fd45642dcecd9ff74cb3e71c20a4753f7d82e2f07864b5108f@%3Cdev.drill.apache.org%3EWEB
- https://github.com/twbs/bootstrap/blob/v3.4.1/js/tooltip.js#L352WEB
- https://github.com/twbs/bootstrap/blob/v3.4.1/js/scrollspy.js#L56WEB
- https://github.com/twbs/bootstrap/blob/v3.4.1/js/collapse.js#L140WEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/bootstrap/CVE-2018-14040.ymlWEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/bootstrap-sass/CVE-2018-14040.ymlWEB
- https://blog.getbootstrap.com/2018/07/12/bootstrap-4-1-2WEB
- https://packetstormsecurity.com/files/152787/dotCMS-5.1.1-Vulnerable-Dependencies.htmlWEB
- https://packetstormsecurity.com/files/156743/OctoberCMS-Insecure-Dependencies.htmlWEB
- https://seclists.org/fulldisclosure/2019/May/10WEB
- https://seclists.org/fulldisclosure/2019/May/11WEB
- https://seclists.org/fulldisclosure/2019/May/13WEB
Frequently Asked Questions
- What is CVE-2018-14040?
- Bootstrap vulnerable to Cross-Site Scripting (XSS). This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.1/10).
- How do I check if my project is affected by CVE-2018-14040?
- CVE-2018-14040 affects bootstrap, org.webjars:bootstrap and bootstrap.sass (and 2 more). It has a 4.1% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2018-14040 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This places it in the top 10% of EPSS-scored vulnerabilities — 91.4% of tracked vulnerabilities score at or below it, so it is substantially more likely to be exploited than most tracked vulnerabilities.
Also Known As
Related CVEs
- CVE-2018-20676MEDIUM
XSS vulnerability that affects bootstrap
- CVE-2016-10735MEDIUM
Bootstrap Cross-site Scripting vulnerability
- CVE-2018-14042MEDIUM
Bootstrap Cross-site Scripting vulnerability
- CVE-2019-8331MEDIUM
Bootstrap Vulnerable to Cross-Site Scripting
- CVE-2016-7103MEDIUM
jQuery-UI vulnerable to Cross-site Scripting in dialog closeText
- CVE-2021-41183MEDIUM
XSS in `*Text` options of the Datepicker widget in jquery-ui
- CVE-2018-20677MEDIUM
bootstrap Cross-site Scripting vulnerability
- CVE-2018-14041MEDIUM
Bootstrap Cross-site Scripting vulnerability