Switch settings to safe yaml load (#19928)

This commit is contained in:
Joshua Wehner 2023-08-16 11:43:00 -04:00 committed by GitHub
parent 3f07d43e72
commit 66e7f8f5e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -153,7 +153,17 @@ module Settings
# get the setting's value, YAML decoded
def value
YAML.unsafe_load(self[:value]) if self[:value].present?
return if self[:value].blank?
YAML.safe_load(self[:value],
permitted_classes: [
ActiveSupport::HashWithIndifferentAccess,
ActiveSupport::TimeZone,
ActiveSupport::TimeWithZone,
BigDecimal,
Symbol,
Time,
])
end
# set the settings's value, YAML encoded