-
Notifications
You must be signed in to change notification settings - Fork 901
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure YAML safe loading in Rails 6.1
As part of the fix for CVE-2022-32224 Rails intruduced safe YAML loading and the `ActiveRecord.yaml_column_permitted_classes` config. PaperTrail added support for respecting the new configuration here #1397 The CVE-2022-32224 fix was also backported to Rails versions 5.2.8.1, 6.0.5.1, and, 6.1.6.1, however the name of the confiuration is slightly different from that in Rails 7.x. 7.0.3.1 ActiveRecord.yaml_column_permitted_classes 6.1.6.1 ActiveRecord::Base.yaml_column_permitted_classes 6.0.5.1 ActiveRecord::Base.yaml_column_permitted_classes 5.2.8.1 ActiveRecord::Base.yaml_column_permitted_classes PaperTrail currently doesn't support this alternative configuration naming, which means it will silent fall back to unsafe YAML loading. This commit updates `PaperTrail::Serializers::YAML` to be compatible with safe YAML loading for the Rails 5.2 / 6.0 / 6.1 branches.
- Loading branch information
Tim Connor
committed
Aug 26, 2022
1 parent
6eb5c39
commit 4a5bd75
Showing
3 changed files
with
53 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters