You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks for your work!
I've been using lodash for a decade and I just discovered that collection-related functions will iterate zero times on {length:0, a:1}.
In your documentation it's stated: collection (Array|Object): The collection to iterate over.
but I can hardly understand Object can be treated as ArrayLike, here.
I believe that most programmers will not expect this behavior, causing a security risk.
What if in a backend environment I validate a serialized object to decide it's safe
This code will fail to block {name:invalidValue, length:0}.
I know this is by design, but even if the documentation was fixed, I see this as too easy to misinterpret.
Even now that I know, I fear to forget. Can you consider adding an option to disable this behavior?
Something like _.disableArrayLikeForCollections = true that I can put in a single point of my project, and feel safer.
The text was updated successfully, but these errors were encountered:
First, thanks for your work!
I've been using lodash for a decade and I just discovered that collection-related functions will iterate zero times on
{length:0, a:1}
.In your documentation it's stated:
collection (Array|Object): The collection to iterate over.
but I can hardly understand Object can be treated as ArrayLike, here.
I believe that most programmers will not expect this behavior, causing a security risk.
What if in a backend environment I validate a serialized object to decide it's safe
This code will fail to block
{name:invalidValue, length:0}
.I know this is by design, but even if the documentation was fixed, I see this as too easy to misinterpret.
Even now that I know, I fear to forget. Can you consider adding an option to disable this behavior?
Something like
_.disableArrayLikeForCollections = true
that I can put in a single point of my project, and feel safer.The text was updated successfully, but these errors were encountered: