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

Deprecate unsafe default options of JSON.load #644

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

casperisfine
Copy link

@casperisfine casperisfine commented Oct 24, 2024

Ref: https://bugs.ruby-lang.org/issues/19528

load is understood as the default method for serializer kind of libraries, and the default options of JSON.load has caused many security vulnerabilities over the years.

The plan is to do like YAML/Psych, deprecate these default options and direct users toward using JSON.unsafe_load so at least it's obvious it shouldn't be used against untrusted data.

@casperisfine casperisfine force-pushed the deprecate-unsafe-load branch from c50c9cd to 798d0f5 Compare October 24, 2024 15:35
@casperisfine casperisfine force-pushed the deprecate-unsafe-load branch 3 times, most recently from 6e91648 to 7719466 Compare October 24, 2024 15:47
@byroot byroot requested a review from eregon October 24, 2024 15:57
[Feature #19528]

Ref: https://bugs.ruby-lang.org/issues/19528

`load` is understood as the default method for serializer kind of libraries, and
the default options of `JSON.load` has caused many security vulnerabilities over the
years.

The plan is to do like YAML/Psych, deprecate these default options and direct
users toward using `JSON.unsafe_load` so at least it's obvious it should be
used against untrusted data.
@casperisfine casperisfine force-pushed the deprecate-unsafe-load branch from 7719466 to 72b92cf Compare October 30, 2024 10:53
@byroot byroot merged commit 94c7e13 into ruby:master Oct 30, 2024
36 checks passed
@casperisfine casperisfine deleted the deprecate-unsafe-load branch October 30, 2024 11:00
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.

2 participants