Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
rawOrlando committed Nov 13, 2023
1 parent ee307f6 commit 9f215b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
# preloads Rails for running tests, you may have to set it to true.
config.eager_load = false

# This resolves an issue loading symbols causing pysch disallowed class error
# Check out https://discuss.rubyonrails.org/t/cve-2022-32224-possible-rce-escalation-bug-with-serialized-columns-in-active-record/81017
config.active_record.yaml_column_permitted_classes = [Symbol, Hash, HashWithIndifferentAccess]

# Configure static file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
config.public_file_server.headers = {
Expand Down
12 changes: 6 additions & 6 deletions config/initializers/active_record.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# config/initializers/active_record.rb
# this has to be here because we need MyClass, which isn't loaded early enough to do in environments/production.rb

Rails.application.config.after_initialize do
# This resolves an issue loading symbols causing pysch disallowed class error
# Check out https://discuss.rubyonrails.org/t/cve-2022-32224-possible-rce-escalation-bug-with-serialized-columns-in-active-record/81017
# ActiveRecord.yaml_column_permitted_classes = [Symbol, Hash, HashWithIndifferentAccess]
config.active_record.yaml_column_permitted_classes = [Symbol, Hash, HashWithIndifferentAccess]
end
# Rails.application.config.after_initialize do
# # This resolves an issue loading symbols causing pysch disallowed class error
# # Check out https://discuss.rubyonrails.org/t/cve-2022-32224-possible-rce-escalation-bug-with-serialized-columns-in-active-record/81017
# # ActiveRecord.yaml_column_permitted_classes = [Symbol, Hash, HashWithIndifferentAccess]
# config.active_record.yaml_column_permitted_classes = [Symbol, Hash, HashWithIndifferentAccess]
# end

0 comments on commit 9f215b0

Please sign in to comment.