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

Use YAML.unsafe_load when available #275

Open
olleolleolle opened this issue Jan 28, 2022 · 7 comments
Open

Use YAML.unsafe_load when available #275

olleolleolle opened this issue Jan 28, 2022 · 7 comments

Comments

@olleolleolle
Copy link
Contributor

olleolleolle commented Jan 28, 2022

Informed by ruby/psych#533 (comment), this Issue notes the availability of the YAML.unsafe_load method, in Psych 4.0.

  • use YAML.unsafe_load if available, OR
  • use YAML.safe_load if available, enabling aliases and all the permitted classes
  • use YAML.load if those methods aren't available (lower versions of Psych)

Location of use:
https://github.com/cschiewek/devise_ldap_authenticatable/blob/default/lib/devise_ldap_authenticatable/ldap/connection.rb

@schlumpfit
Copy link

schlumpfit commented Feb 24, 2022

Hi @olleolleolle,

it does not use unsafe_load, but should be compatible with psych <4 as well as with psych > 4. The solution is copied from rails...

#276

Edit: As a workaround I am just using gem 'psych', '< 4.0'

@net1957
Copy link

net1957 commented May 17, 2022

would be nice to have a new release with @schlumpfit proposal.
with ruby 3.0.4 this problem is present in multiples applications that are using yaml aliases

@Ivanov-Anton
Copy link

same problem

@Ivanov-Anton
Copy link

seems like this issue has already fixes in the psych repo follow the link below

ruby/psych#567

@net1957
Copy link

net1957 commented Jun 22, 2023

yes, but this gem was not modified to allow aliases

@Ivanov-Anton
Copy link

What do you suggest to me?

Maybe do not use aliases in the LDAP YML file? Or something else?

@net1957
Copy link

net1957 commented Jun 23, 2023

pass aliases: true to YAML.safe_load

see #276

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

4 participants