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

Don't allow where with non numeric string matches to 0 values #35336

Merged

Conversation

kamipo
Copy link
Member

@kamipo kamipo commented Feb 20, 2019

This is a follow-up of #35310.

Currently Topic.find_by(id: "not-a-number") matches to a id = 0
record. That is considered as silently leaking information.

If non numeric string is given to find by an integer column, it should
not be matched to any record.

Related #12793.

This is a follow-up of rails#35310.

Currently `Topic.find_by(id: "not-a-number")` matches to a `id = 0`
record. That is considered as silently leaking information.

If non numeric string is given to find by an integer column, it should
not be matched to any record.

Related rails#12793.
@kamipo kamipo merged commit f8a798c into rails:master Feb 21, 2019
@kamipo kamipo deleted the dont_allow_non_numeric_string_matches_to_zero branch February 21, 2019 09:58
kamipo added a commit to kamipo/rails that referenced this pull request Mar 4, 2021
Related to rails#35336.

The notable thing about rails#41516 is that unknown labels will no longer
match 0 on MySQL.

Matching unknown labels to 0 was not by design, but rather almost like a
bug, people should not rely on that behavior.

Closes rails#41595.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant