-
Notifications
You must be signed in to change notification settings - Fork 909
Default serializer will use YAML.safe_load #1397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or 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
Breaking change. Going forward, PT's default serializer (PaperTrail::Serializers::YAML) will use `safe_load` unless `ActiveRecord.use_yaml_unsafe_load`. PT users are required to configure `ActiveRecord.yaml_column_permitted_classes` correctly for their own application. Users may want to start with the following safe-list: ```ruby ::ActiveRecord.use_yaml_unsafe_load = false ::ActiveRecord.yaml_column_permitted_classes = [ ::ActiveRecord::Type::Time::Value, ::ActiveSupport::TimeWithZone, ::ActiveSupport::TimeZone, ::BigDecimal, ::Date, ::Symbol, ::Time ] ```
tlconnor
pushed a commit
to tlconnor/paper_trail
that referenced
this pull request
Aug 26, 2022
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 paper-trail-gem#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.
6 tasks
tlconnor
pushed a commit
to tlconnor/paper_trail
that referenced
this pull request
Aug 26, 2022
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 paper-trail-gem#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.
tlconnor
pushed a commit
to tlconnor/paper_trail
that referenced
this pull request
Aug 26, 2022
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 paper-trail-gem#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.
tlconnor
pushed a commit
to tlconnor/paper_trail
that referenced
this pull request
Aug 26, 2022
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 paper-trail-gem#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.
jaredbeck
pushed a commit
that referenced
this pull request
Oct 16, 2022
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.
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Breaking change.
Going forward, PT's default serializer (PaperTrail::Serializers::YAML)
will use
safe_loadunlessActiveRecord.use_yaml_unsafe_load.PT users are required to configure
ActiveRecord.yaml_column_permitted_classescorrectly for their own application. Users may want to start with the following
safe-list: