Unsafe fall-through in getWhereConditions
Published 23 Feb 2023 · Updated 8 Nov 2023
Affected packages
- Affected
- <6.28.1
- Fixed in
- 6.28.1
npm install sequelize@6.28.1- Affected
- <7.0.0-alpha.20
- Fixed in
- 7.0.0-alpha.20
npm install @sequelize/core@7.0.0-alpha.20Details
Impact
Providing an invalid value to the where option of a query caused Sequelize to ignore that option instead of throwing an error.
A finder call like the following did not throw an error:
User.findAll({
where: new Date(),
});As this option is typically used with plain javascript objects, be aware that this only happens at the top level of this option.
Patches
This issue has been patched in `sequelize@6.28.1` & `@sequelize/core@7.0.0.alpha-20`
References
A discussion thread about this issue is open at https://github.com/sequelize/sequelize/discussions/15698
CVE: CVE-2023-22579 Snyk: https://security.snyk.io/vuln/SNYK-JS-SEQUELIZE-3324090
Is GHSA-vqfx-gj96-3w95 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected sequelize, and gives you the command that fixes it.
References
- Linkgithub.com/sequelize/sequelize/security/advisories/GHSA-vqfx-gj96-3w95
- Advisorynvd.nist.gov/vuln/detail/CVE-2023-22579
- Linkgithub.com/sequelize/sequelize/pull/15375
- Linkgithub.com/sequelize/sequelize/pull/15699
- Linkcsirt.divd.nl/CVE-2023-22579
- Linkcsirt.divd.nl/DIVD-2022-00020
- Packagegithub.com/sequelize/sequelize
- Linkgithub.com/sequelize/sequelize/discussions/15698
- Linkgithub.com/sequelize/sequelize/releases/tag/v6.28.1
- Linkgithub.com/sequelize/sequelize/releases/tag/v7.0.0-alpha.20
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.