-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Progress Bars violate CSP style-src directive unless directive has 'unsafe-inline' in it #17785
Comments
That hack (add 100 declarations, one for each percentage point) is pretty gnarly; probably too gnarly for us to pursue. |
An option a co-worker suggested to me ( @RobertWHurst ) was to put the style code into JS. |
As JS is needed anyway to make the progress bar actually work, this may be an option. My preference for v4 would be to use actual |
I'm in favor of that.
Woof, sounds like a lot of overhead for not a lot of gain. |
I propose documenting this and deeming it WontFix: #18080.
Eh, not really, IMHO. Progress bars that are only updated on page load are a thing. |
If you set the element's width through JavaScript it wont violate the CSP policy: element.style.width = '30%'; |
* tag 'v3.3.6' of https://github.com/twbs/bootstrap: (356 commits) prep release grunt after version bump bump version grunt Updating "Reporting upstream browser bugs" for IE Docs: Add missing `tabindex="-1"` & `role="dialog"` to some `.modal`s Ensure proper z-indexing in input-groups Fix IE9 clickthru of carousel controls that @cvrebert lifestyle fixes twbs#17003 [v3] Use border-radius mixin in button-groups.less Follow up to twbs#16975 Run `grunt`. Update devDependencies. Update verb tenses to proper tense for feature deprecations Port 33103c0 to v3 Port 6f14f02 to v3 Add http://wkbug.com/150715 to Wall of Browser Bugs Add docs regarding .progress, inline style attrs, and CSP; closes twbs#17785 Run `grunt. ...
I see this in the docs for v3.3.5 but I'm using an older 3.x version and see the behavior in my application.
From the docs: http://getbootstrap.com/components/#progress
That last attribute, the inline style, causes a CSP violation for me (and I assume anyone else using an effective CSP policy, since
'unsafe-inline'
is considered, well, unsafe).A bit of searching helped me find an existing workaround for this issue: https://github.com/danielnixon/bootstrap-hacks/blob/master/progressbar.css
One thing to note is that I had to do a round on my percent values in order to make the
bootstrap-hacks
package work properly (e.g.aria-valuenow="50.0"
doesn't work butaria-valuenow="50"
does).The text was updated successfully, but these errors were encountered: