-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
CSS injection with width and height options #546
Comments
Hello! My app stopped working after updating to 3.4 - I use I think all units should be whitelisted - in other apps I also use regards! |
Hey @cernyjakub, can you share the exact values you're trying to use that aren't working? |
This is the exact line from Sentry trace:
I use |
Hey @cernyjakub, 3.4.1 was just released which allows for the |
Thanks for patching this, works fine for me! |
The Chartkick Ruby gem is vulnerable to CSS injection if user input is passed to the
width
orheight
option. This vulnerability has been assigned the CVE identifier CVE-2020-16254.Versions Affected: 3.3.2 and below
Fixed Versions: 3.4.0
Impact
Chartkick is vulnerable to CSS injection if user input is passed to the
width
orheight
option.An attacker can set additional CSS properties, like:
All users running an affected release should upgrade.
Technical Details
Chartkick uses
ERB::Util.html_escape
to escape the width and height. This prevents XSS, but does not escape semicolons, which allows CSS additional properties to be set. Chartkick now limits width and height values to alphanumeric and % (this prevents some valid values likecalc()
but keeps things simple).The text was updated successfully, but these errors were encountered: