Our WorkAbout UsOur ApproachThe Journal
Contact »
« Back to the journal
Frontend Development

Bootstrap 3 Vulnerability


Nick Stewart
Nick Stewart

on 1/31/2019

Earlier last year it was made known that Bootstrap 3.x suffers from a XSS vulnerability. This vulnerability allows malicious users to target the data-attribute and href attributes and pass code through. The vulnerability was “found in an application where data-target was based on user input and only passed through standard HTML entities encoding”. With Bootstrap 4 available, all work on Bootstrap 3.x has been stopped and there hasn’t been a fix for this issue, leaving sites that can’t upgrade to Bootstrap 4 to fend for themselves.

The Vulnerability

The user input is passed directly to the selector and there is no filtering. For instance:

The Fix

However in September, a Bootstrap maintainer named XhmikosR started working on a fix for all the users still on 3.x (as seen above). Currently the fix is waiting to be reviewed and approved, so it can go out as an official release. You can find the branch here.

Since the fix is available on Github though, you can go ahead and apply it as a patch while the release is still under review. For people that use a build system, I’ve pulled out all the Javascript and LESS files and placed them in a package on NPM. With this, you can pull down the package and point your build system to those files instead of Bootstrap’s and then when the release becomes official, just point back to the official files.

The official release however should be released soon.

Share to

Related Posts

What's the JAMstack?

By:Alec Robertson

As a front-end developer in 2020, it is time that I fulfill the FEDeral mandate that I publish words regarding the JAMStack. If you follow too many developers on Twitter, it’s likely you’ve heard about the Next Big Thing in web development, but I’d like to put this trend (fad? movement?) into context to better understand what’s truly new about this approach and whether it’s worth using.

Read More »
Custom Bootstrap Shortcodes for WordPress

By: Natalie Miller on 6/27/2017

Bootstrap shortcodes are a quick way to make your WordPress content more dynamic.

Read More »