Repository navigation
feat: throw an error if attribute includes parentheses (fixes CVE-2023-22578) - #15710
Conversation
|
I'm not sure if we want to throw to be honest. I would prefer to use the v7 option by default and add this text to the release notes. Otherwise we'll get replies from people that might not see the direct error but do get failing tests |
|
If we don't throw, then their code is going to break anyway but without any explanation. |
|
Ah wait, we're only throwing when parantheses are used. I misread earlier |
|
Oh yes, always throwing would be horrible 😅 |
|
🎉 This PR is included in version 6.29.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The goal of this PR is to fix CVE-2023-22578 in Sequelize 6 (thread)
Unlike in v7 where we always escape all non-literal attributes, in v6 using parentheses in an attribute will throw an error by default. This is deliberate to warn users that relied on this feature that the behavior changed.
Users then have 3 options:
literal()call. This will make Sequelize treat it as raw SQL.attributeBehaviorsequelize option to"escape"to make Sequelize escape the attribute, like in Sequelize v7. We highly recommend this option.attributeBehaviorsequelize option to"unsafe-legacy"to make Sequelize escape the attribute, like in Sequelize v5.That feature was deprecated years ago in Sequelize 5. It's still a breaking change, but this is the lesser of the two evil we settled on.