Skip to content
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

Psych::DisallowedClass exception is raised when creating a Webpush notification in Rails 6.1.6.1 #643

Open
marvs opened this issue Jul 20, 2022 · 1 comment

Comments

@marvs
Copy link

marvs commented Jul 20, 2022

Describe the bug
Rails 6.1.6.1 introduces a fix for CVE-2022-32224 - https://discuss.rubyonrails.org/t/cve-2022-32224-possible-rce-escalation-bug-with-serialized-columns-in-active-record/81017

With this patch, it changed the default YAML deserializer to use YAML.safe_load, which prevents deserialization of possibly dangerous objects. By default it does not allow all classes to be deserialized.

When creating a new Webpush notification, it returns an exception because of the symbolized keys that are required in the Registration parameters.

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade to Rails 6.1.6.1
  2. Create a new Webpush notification
notification = Rpush::Webpush::Notification.new
notification.registration_ids = [{ endpoint: 'someendpoint', keys: { 'auth' => 'someauth' } }]
notification.save!
  1. It returns an exception
Psych::DisallowedClass Tried to load unspecified class: Symbol

Expected behavior
Notification is saved successfully.

System configuration (please complete the following information):

  • OS: any
  • Ruby version: 2.7
  • Rails version: 6.1.6.1
  • Rpush version: 5.4.0
@Pe-co
Copy link

Pe-co commented Feb 22, 2023

Is there a workaround for this, or an expected fix? I think i have encountered this as well.

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

No branches or pull requests

2 participants