CSS Injection Affecting chartkick package, versions <3.4.0


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.14% (51st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-RUBY-CHARTKICK-597471
  • published6 Aug 2020
  • disclosed6 Aug 2020
  • creditUnknown

Introduced: 6 Aug 2020

CVE-2020-16254  (opens in a new tab)
CWE-74  (opens in a new tab)

How to fix?

Upgrade chartkick to version 3.4.0 or higher.

Overview

chartkick is a Ruby gem that allows creation of JavaScript charts.

Affected versions of this package are vulnerable to CSS Injection. Chartkick is vulnerable to CSS injection if user input is passed to the width or height option.

<%= line_chart data, width: params[:width], height: params[:height] %>

An attacker can set additional CSS properties, like:

<%= line_chart data, width: "100%; background-image: url('http://example.com/image.png')" %>

References

CVSS Scores

version 3.1