Skip to content

Commit

Permalink
Merge pull request #865 from alphagov/workaround-kaminari
Browse files Browse the repository at this point in the history
Add a manual workaround for Kaminari security issue
  • Loading branch information
thomasleese authored Dec 9, 2020
2 parents 39d7bc6 + da355e9 commit 29e0c89
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config/initializers/kaminari_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,12 @@

Kaminari::Hooks.init if defined?(Kaminari::Hooks)
Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari

# This is a workaround suggested by the Kaminari team to fix a security issue:
# https://github.com/kaminari/kaminari/security/advisories/GHSA-r5jw-62xg-j433
#
# Ideally we would upgrade to Kaminari 1.2, but we can't because:
# https://github.com/elastic/elasticsearch-rails/issues/966
module Kaminari::Helpers
PARAM_KEY_EXCEPT_LIST = [:authenticity_token, :commit, :utf8, :_method, :script_name, :original_script_name].freeze
end

0 comments on commit 29e0c89

Please sign in to comment.