Skip to content

Rails 5.2 #3

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 6 commits into from
Feb 25, 2025
Merged

Rails 5.2 #3

merged 6 commits into from
Feb 25, 2025

Conversation

pboling
Copy link
Member

@pboling pboling commented Feb 25, 2025

No description provided.

- drop-in replacement for ⚰️ruby-openid⚰️
Rails 5.2.8.1 is a security patch release to fix CVE-2022-32224.
See: https://discuss.rubyonrails.org/t/cve-2022-32224-possible-rce-escalation-bug-with-serialized-columns-in-active-record/81017

The patch (Rails v5.2.8.1) causes an error with `masq` v0.3.4
(... actually it doesn't work at all on Rails v5, but some forks have been fixed):

```
Psych::DisallowedClass: Tried to load unspecified class: ActiveSupport::HashWithIndifferentAccess
```

when serializing a Hash the way we had done in previous versions `app/models/masq/open_id_request.rb`:
```ruby
serialize :parameters, Hash
```

so we instead switch to serializing as JSON:
```ruby
serialize :parameters, JSON
```

If an implementation needs to continue using the serialized Hash,
you will need to override the definition by reopening the model, and adding:

```ruby
serialize :parameters, Hash
```

In addition, one of the following is also needed.

1. Simple, but insecure fix, which reverts to previous unpatched behavior is:

      ```ruby
      Rails.application.config.active_record.use_yaml_unsafe_load = true
      ```

2. More complex, and a bit less insecure fix, is to explicitly list the allowed classes to serialize:

      ```ruby
      Rails.application.config.active_record.yaml_column_permitted_classes = [Symbol, Date, Time, HashWithIndifferentAccess]
      ```
- switch to require_relative
…ite3Adapter.represent_boolean_as_integer`

  set to false is deprecated
@pboling pboling merged commit 58dc914 into main Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant