Skip to content

Commit a814d68

Browse files
authored
Merge pull request #3231 from DMPRoadmap/add_symbol_to_safe_yaml_list
fix YAML safe load capatibility potential error
2 parents 2277cea + 2092d80 commit a814d68

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

config/application.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ class Application < Rails::Application
2626
# --------------------------------- #
2727
# Ensure that Zeitwerk knows to load our classes in the lib directory
2828
config.eager_load_paths << config.root.join('lib')
29+
30+
# CVE-2022-32224: add some compatibility with YAML.safe_load
31+
# Rails 5,6,7 are using YAML.safe_load as the default YAML deserializer
32+
config.active_record.yaml_column_permitted_classes = [ActiveSupport::HashWithIndifferentAccess, Symbol, Date, Time]
33+
2934
# Have Zeitwerk skip generators because the generator templates are
3035
# incompatible with the Rails module/class naming conventions
3136
Rails.autoloaders.main.ignore(config.root.join('lib/generators'))

db/schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,4 +666,4 @@
666666
add_foreign_key "users", "departments"
667667
add_foreign_key "users", "languages"
668668
add_foreign_key "users", "orgs"
669-
end
669+
end

0 commit comments

Comments
 (0)