V6: Removing operator aliases
See original GitHub issueWith the v6 release we are looking to entirely remove operator aliasing support eg. $eq
$gt
$and
etc. in favor of the symbol based operators introduced in v4 and enabled by default in v5.
Aliased operators are potentially vulnerable to user input injection when passing certain user generated input into sequelize calls. This is especially problematic for query string parsers that support complex data structures. For more details please see previous migration guides and documentation.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:14 (9 by maintainers)
Top Results From Across the Web
Model Querying - Basics - Sequelize
When using aggregation function, you must give it an alias to be able to access it from the model. In the example above...
Read more >Sequelize Deprecated Error Message - node.js - Stack Overflow
As of Version 5, the operatorAliases will cause a warning: "DeprecationWarning: String based operators are deprecated.
Read more >Function and Operator Reference | PingCAP Docs
Learn how to use the functions and operators. ... Function and Operator Referencewas last updated 11/15/2022, 9:59:55 PM: v6.4: remove aliases (#11327).
Read more >Risks involved with operatorAliases in Sequelize - Wallarm
Not having any string aliases will make it extremely unlikely that operators could be injected but you should always properly validate and ...
Read more >Masks -- IM v6 Examples - ImageMagick
Internal Matte Channel; Alpha Channel Operator. Off (or +matte), Set (or -matte ), On , Opaque , Transparent , Extract , Copy ,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t think using symbols instead of string keys somehow improves security.
the issue is not in strings or symbols but in how apps process user input. Even documentation says something like: it will help but don’t forget to sanitize input. With symbols, a dev can make his code vulnerable to injection as well, the only thing which needs to be done is to map string keys to symbol keys.
Frankly speaking, not a big deal 😃 I don’t think symbols operators somehow help but add a bit of complexity.
@kevinlammers it always was the problem of the developer not sequelize (I argued about the purpose of removing operators in previous comments https://github.com/sequelize/sequelize/issues/10820#issuecomment-501959070).
Now the “life” is a bit more complicated, it’s more complicated to send a silly/hard coded sequelize query from client to server. But it was always a wrong approach!
If you want to do rich filtering or sorting from the client, you need to