CVE-2020-11082: Kaminari Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-r5jw-62xg-j433
CVSS 6.4
CWE-79
Published
Advisory Summary

CVE-2020-11082 is a MODERATE (CVSS 6.4) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Kaminari libraries in the RubyGems ecosystem. The issue involves cross-site scripting in kaminari. Remediation is available by upgrading affected packages to version 1.2.1.

CVE-2020-11082 at a Glance

CVE Identifier CVE-2020-11082
GHSA Identifier GHSA-r5jw-62xg-j433
Severity MODERATE
CVSS v3.1 Base Score 6.4
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Kaminari
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 6.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2020-11082

To remediate this vulnerability, upgrade all affected Kaminari dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

kaminari fixed: 1.2.1
Upgrade kaminari to 1.2.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for kaminari

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-11082, inspect your project dependencies for Kaminari:

inspect dependencies for kaminari

Analyze the terminal output to locate any version of Kaminari in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Kaminari, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact In Kaminari before 1.2.1, there is a vulnerability that would allow an attacker to inject arbitrary code into pages with pagination links. This has been fixed in 1.2.1. ### Releases The 1.2.1 gem including the patch has already been released. All past released versions are affected by this vulnerability. ### Workarounds Application developers who can't update the gem can workaround by overriding the `PARAM_KEY_EXCEPT_LIST` constant. ```ruby module Kaminari::Helpers PARAM_KEY_EXCEPT_LIST = [:authenticity_token, :commit, :utf8, :_method, :script_name, :original_script_name].freeze end ``` ### Credits Thanks to Daniel Mircea for finding the issue and sending a patch via GitHub. Also thanks to Aditya Prakash for reporting the vulnerability.

CVE-2020-11082 Affected Kaminari Versions

1 component(s)
Fixed Versions:
1.2.1
Product / Package Ecosystem Affected Versions Fixed Version
kaminari
RubyGems
< 1.2.1
1.2.1

References

Frequently Asked Questions

What is CVE-2020-11082?
CVE-2020-11082 is a security vulnerability in Kaminari involving Cross-Site Scripting in Kaminari under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Kaminari versions are affected?
Affected versions include releases prior to 1.2.1 across affected packages: kaminari.
What version fixes CVE-2020-11082?
Upgrading to 1.2.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is kaminari affected?
Yes, kaminari is affected in releases prior to 1.2.1. Upgrade your dependency to 1.2.1 or later.
What is the CVSS score of CVE-2020-11082?
CVE-2020-11082 has a CVSS v3.1 base score of 6.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:L.
What CWE is associated with CVE-2020-11082?
CVE-2020-11082 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check RubyGems dependencies for CVE-2020-11082?
Run the dependency tree command: 'inspect dependencies for kaminari'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-r5jw-62xg-j433",
  "modified" : "2021-09-23T13:55:11Z",
  "published" : "2020-05-28T21:10:11Z",
  "aliases" : [ "CVE-2020-11082" ],
  "summary" : "Cross-Site Scripting in Kaminari",
  "details" : "### Impact\nIn Kaminari before 1.2.1, there is a vulnerability that would allow an attacker to inject arbitrary code into pages with pagination links. This has been fixed in 1.2.1.\n\n### Releases\nThe 1.2.1 gem including the patch has already been released.\nAll past released versions are affected by this vulnerability.\n\n### Workarounds\nApplication developers who can't update the gem can workaround by overriding the `PARAM_KEY_EXCEPT_LIST` constant.\n\n```ruby\nmodule Kaminari::Helpers\n  PARAM_KEY_EXCEPT_LIST = [:authenticity_token, :commit, :utf8, :_method, :script_name, :original_script_name].freeze\nend\n```\n\n### Credits\nThanks to Daniel Mircea for finding the issue and sending a patch via GitHub. Also thanks to Aditya Prakash for reporting the vulnerability.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "kaminari"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/kaminari/kaminari/security/advisories/GHSA-r5jw-62xg-j433"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-11082"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/github/advisory-review/pull/1020"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kaminari/kaminari/commit/8dd52a1aed3d2fa2835d836de23fc0d8c4ff5db8"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kaminari/kaminari"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/kaminari/CVE-2020-11082.yml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2021/09/msg00011.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2021/dsa-5005"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-05-28T21:05:32Z",
    "nvd_published_at" : "2020-05-28T21:15:00Z"
  }
}