i18n-active_record icon indicating copy to clipboard operation
i18n-active_record copied to clipboard

rails 7.0.3.1: Psych::DisallowedClass: Tried to load unspecified class: Symbol

Open sobakasu opened this issue 2 years ago • 1 comments

We get an error with rails 7.0.3.1. Downgrading to rails 7.0.3 fixes the error.

The error is: Psych::DisallowedClass: Tried to load unspecified class: Symbol

steps to reproduce:

errors = ActiveModel::Errors.new(model)
errors.add(:attribute, :blank)
errors[:attribute]

another workaround:

config.active_record.yaml_column_permitted_classes = [Symbol, Date, Time]

seems to be caused by https://discuss.rubyonrails.org/t/cve-2022-32224-possible-rce-escalation-bug-with-serialized-columns-in-active-record/81017

sobakasu avatar Jul 14 '22 01:07 sobakasu

Thanks for reporting the issue

I think the only thing we can do now is to wait once the issue will be fixed in Rails.
In the meantime, we should use the provided workaround

timfjord avatar Jul 14 '22 12:07 timfjord