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

Fixes Alias parsing was not enabled issue while loading Psych Lib in safe_load #9759

Merged
merged 5 commits into from
May 20, 2024

Conversation

sachin-sandhu
Copy link
Contributor

@sachin-sandhu sachin-sandhu commented May 17, 2024

Fixes issue : #9505

Issue Description : Link to original issue Sentry issue .After Dependabot update #8854 , Psych library load started throwing exception Psych::AliasesNotEnabled Full detail . This is likely due to incompatibility between Ruby and psych https://bugs.ruby-lang.org/issues/17866 .

Resolution : : While enabling aliases: true is assumed safe, There is a small possibility to crash the function on certain YAML load ( link #5 ) . I propose to release the fix to stage environment and observe the fix for several days before merging to main branch.

@sachin-sandhu sachin-sandhu requested a review from a team as a code owner May 17, 2024 14:01
@sachin-sandhu sachin-sandhu self-assigned this May 17, 2024
@github-actions github-actions bot added the L: dart:pub Dart packages via pub label May 17, 2024
@honeyankit
Copy link
Contributor

@sachin-sandhu Is is possible to add a test case for this case?

@sachin-sandhu
Copy link
Contributor Author

@sachin-sandhu Is is possible to add a test case for this case?

Hi @honeyankit , I have added test cases as following:

  1. Loads file a YAML file with alias using YAML.safe_load(data, aliases: true) . Expected not to raise exception
  2. Loads file a YAML file with alias using YAML.safe_load(data, aliases: false) . Expected to raise exception (Psych::AliasesNotEnabled)
  3. Loads file a YAML file with no alias using YAML.safe_load(data, aliases: true) . Expected not to raise exception

Adding new line at end of file
modified the YAML file contents
Copy link
Contributor

@honeyankit honeyankit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding test!

@sachin-sandhu sachin-sandhu merged commit 3ed63ea into main May 20, 2024
54 checks passed
@sachin-sandhu sachin-sandhu deleted the ssandhu/9505-Alias-parsing-was-not-enabled branch May 20, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: dart:pub Dart packages via pub
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants