Skip to content

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

Merged
kamipo merged 1 commit intorails:masterfrom
kamipo:dont_allow_non_numeric_string_matches_to_zero
Feb 21, 2019
Merged

Don't allow where with non numeric string matches to 0 values#35336
kamipo merged 1 commit intorails:masterfrom
kamipo:dont_allow_non_numeric_string_matches_to_zero

Conversation

@kamipo
Copy link
Copy Markdown
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.

1 participant