CSS Injection Affecting chartkick package, versions <3.4.0


0.0
high

Snyk CVSS

    Attack Complexity Low
    Confidentiality High

    Threat Intelligence

    EPSS 0.08% (32nd percentile)
Expand this section
NVD
6.1 medium

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 ID SNYK-RUBY-CHARTKICK-597471
  • published 6 Aug 2020
  • disclosed 6 Aug 2020
  • credit Unknown

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