Sequelize 6.28.2 and prior has a dangerous feature where using parentheses in the attribute option would make Sequelize use the string as-is in the SQL
In Sequelize 6, it throws an error explaining that we had to introduce a breaking change, and requires the user to explicitly opt-in to either the Sequelize 7 behavior (always escape) or the Sequelize 5 behavior (inline attributes that include () without escaping). See https://github.com/sequelize/sequelize/pull/15710 for more information.
Mitigations
Do not use user-provided content to build your list or attributes. If you do, make sure that attribute in question actually exists on your model by checking that it exists in the rawAttributes property of your model first.
This PR contains the following updates:
6.21.6
->6.29.0
GitHub Vulnerability Alerts
CVE-2023-22580
Due to improper input filtering in the sequelize js library, can malicious queries lead to sensitive information disclosure.
CVE-2023-22579
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:
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
CVE-2023-22578
Impact
Sequelize 6.28.2 and prior has a dangerous feature where using parentheses in the attribute option would make Sequelize use the string as-is in the SQL
Produced
Patches
This feature was deprecated in Sequelize 5, and using it prints a deprecation warning.
This issue has been patched in
@sequelize/core@7.0.0.alpha-20
andsequelize@6.29.0
.In Sequelize 7, it now produces the following:
In Sequelize 6, it throws an error explaining that we had to introduce a breaking change, and requires the user to explicitly opt-in to either the Sequelize 7 behavior (always escape) or the Sequelize 5 behavior (inline attributes that include
()
without escaping). See https://github.com/sequelize/sequelize/pull/15710 for more information.Mitigations
Do not use user-provided content to build your list or attributes. If you do, make sure that attribute in question actually exists on your model by checking that it exists in the
rawAttributes
property of your model first.A discussion thread about this issue is open at https://github.com/sequelize/sequelize/discussions/15694 CVE: CVE-2023-22578
Release Notes
sequelize/sequelize (sequelize)
### [`v6.29.0`](https://togithub.com/sequelize/sequelize/releases/tag/v6.29.0) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.28.2...v6.29.0) ##### Features - throw an error if attribute includes parentheses (fixes CVE-2023-22578) ([#15710](https://togithub.com/sequelize/sequelize/issues/15710)) ([d3f5b5a](https://togithub.com/sequelize/sequelize/commit/d3f5b5a65e297f4b6861e6a6ce335a9830b28781)) ### [`v6.28.2`](https://togithub.com/sequelize/sequelize/releases/tag/v6.28.2) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.28.1...v6.28.2) ##### Bug Fixes - accept undefined in where ([#15703](https://togithub.com/sequelize/sequelize/issues/15703)) ([13f2e89](https://togithub.com/sequelize/sequelize/commit/13f2e89f8b6147897e3e43f01487de51aebcde87)) ### [`v6.28.1`](https://togithub.com/sequelize/sequelize/releases/tag/v6.28.1) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.28.0...v6.28.1) ##### Bug Fixes - throw if where receives an invalid value ([#15699](https://togithub.com/sequelize/sequelize/issues/15699)) ([d9e0728](https://togithub.com/sequelize/sequelize/commit/d9e0728f2c2c5ae319f337c78091e1081440595d)) - update moment-timezone version ([#15685](https://togithub.com/sequelize/sequelize/issues/15685)) ([48d6193](https://togithub.com/sequelize/sequelize/commit/48d619379108320831c9c6a0ec42bfda6586fec5)) ### [`v6.28.0`](https://togithub.com/sequelize/sequelize/releases/tag/v6.28.0) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.27.0...v6.28.0) ##### Features - **types:** use retry-as-promised types for retry options to match documentation ([#15484](https://togithub.com/sequelize/sequelize/issues/15484)) ([fd4afa6](https://togithub.com/sequelize/sequelize/commit/fd4afa6a89c111c6d6d0c94f0b98bf421b5357b6)) ### [`v6.27.0`](https://togithub.com/sequelize/sequelize/releases/tag/v6.27.0) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.26.0...v6.27.0) ##### Features - add support for bigints (backport of [#14485](https://togithub.com/sequelize/sequelize/issues/14485)) ([#15413](https://togithub.com/sequelize/sequelize/issues/15413)) ([1247c01](https://togithub.com/sequelize/sequelize/commit/1247c01265743e4bdbd6d91a51cf64cd9d1e6617)) ### [`v6.26.0`](https://togithub.com/sequelize/sequelize/releases/tag/v6.26.0) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.25.8...v6.26.0) ##### Features - **postgres:** add support for lock_timeout \[[#15345](https://togithub.com/sequelize/sequelize/issues/15345)] ([#15355](https://togithub.com/sequelize/sequelize/issues/15355)) ([94beace](https://togithub.com/sequelize/sequelize/commit/94beace4ca666765ec9c84a3f7ef0e826e09699d)) ### [`v6.25.8`](https://togithub.com/sequelize/sequelize/releases/tag/v6.25.8) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.25.7...v6.25.8) ##### Bug Fixes - **oracle:** remove hardcoded maxRows value ([#15323](https://togithub.com/sequelize/sequelize/issues/15323)) ([7885000](https://togithub.com/sequelize/sequelize/commit/7885000a70eb451100fa8f54d45361887241521c)) ### [`v6.25.7`](https://togithub.com/sequelize/sequelize/releases/tag/v6.25.7) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.25.6...v6.25.7) ##### Bug Fixes - fix parameters not being replaced when after $$ strings ([#15307](https://togithub.com/sequelize/sequelize/issues/15307)) ([bc39fd6](https://togithub.com/sequelize/sequelize/commit/bc39fd69919e0af0cb0732ca9bfe3e60691c778a)) ### [`v6.25.6`](https://togithub.com/sequelize/sequelize/releases/tag/v6.25.6) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.25.5...v6.25.6) ##### Bug Fixes - **postgres:** invalidate connection after client-side timeout ([#15283](https://togithub.com/sequelize/sequelize/issues/15283)) ([a205765](https://togithub.com/sequelize/sequelize/commit/a20576527b84d4986372b25303b61536fae7479a)), closes [/github.com/brianc/node-postgres/blob/5538df6b446f4b4f921947b460fe38acb897e579/packages/pg/lib/client.js#L529](https://togithub.com//github.com/brianc/node-postgres/blob/5538df6b446f4b4f921947b460fe38acb897e579/packages/pg/lib/client.js/issues/L529) ### [`v6.25.5`](https://togithub.com/sequelize/sequelize/releases/tag/v6.25.5) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.25.4...v6.25.5) ##### Bug Fixes - remove options.model overwrite on bulkUpdate ([#15252](https://togithub.com/sequelize/sequelize/issues/15252)) ([67e69cd](https://togithub.com/sequelize/sequelize/commit/67e69cdb0e9d3dc16f61449cf0cf4f609c724719)), closes [#15231](https://togithub.com/sequelize/sequelize/issues/15231) ### [`v6.25.4`](https://togithub.com/sequelize/sequelize/releases/tag/v6.25.4) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.25.3...v6.25.4) ##### Bug Fixes - **types:** add instance.dataValues property to model.d.ts ([#15240](https://togithub.com/sequelize/sequelize/issues/15240)) ([00c6da3](https://togithub.com/sequelize/sequelize/commit/00c6da326630a85363b6d5e7d5570ac8ca8b31b8)) ### [`v6.25.3`](https://togithub.com/sequelize/sequelize/releases/tag/v6.25.3) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.25.2...v6.25.3) ##### Bug Fixes - don't treat \ as escape in standard strings, support E-strings, support vars after ->> operator, treat lowercase e as valid e-string prefix ([#15139](https://togithub.com/sequelize/sequelize/issues/15139)) ([7990095](https://togithub.com/sequelize/sequelize/commit/7990095e369b226844669ec691cc7bce94c3dbbe)), closes [#14700](https://togithub.com/sequelize/sequelize/issues/14700) ### [`v6.25.2`](https://togithub.com/sequelize/sequelize/releases/tag/v6.25.2) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.25.1...v6.25.2) ##### Bug Fixes - **types:** fix TS 4.9 excessive depth error on `InferAttributes` (v6) ([#15135](https://togithub.com/sequelize/sequelize/issues/15135)) ([851daaf](https://togithub.com/sequelize/sequelize/commit/851daafc73ff218f7de4455fe9f96eb896106210)) ### [`v6.25.1`](https://togithub.com/sequelize/sequelize/releases/tag/v6.25.1) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.25.0...v6.25.1) ##### Bug Fixes - **types:** expose legacy "types" folder in export alias ( [#15123](https://togithub.com/sequelize/sequelize/issues/15123)) ([9dd93b8](https://togithub.com/sequelize/sequelize/commit/9dd93b8461b0ff0452d7db998d0686c3ef176150)) ### [`v6.25.0`](https://togithub.com/sequelize/sequelize/releases/tag/v6.25.0) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.24.0...v6.25.0) ##### Features - **oracle:** add support for `dialectOptions.connectString` ([#15042](https://togithub.com/sequelize/sequelize/issues/15042)) ([06ad05d](https://togithub.com/sequelize/sequelize/commit/06ad05df260a745cf97bc8e7365c74aea57e5220)) ### [`v6.24.0`](https://togithub.com/sequelize/sequelize/releases/tag/v6.24.0) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.23.2...v6.24.0) ##### Features - **snowflake:** Add support for `QueryGenerator#tableExistsQuery` ([#15087](https://togithub.com/sequelize/sequelize/issues/15087)) ([a44772e](https://togithub.com/sequelize/sequelize/commit/a44772ec58175cfdc2cea84eb359966e48ed1c7b)) ### [`v6.23.2`](https://togithub.com/sequelize/sequelize/releases/tag/v6.23.2) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.23.1...v6.23.2) ##### Bug Fixes - **postgres:** add custom order direction to subQuery ordering with minified alias ([#15056](https://togithub.com/sequelize/sequelize/issues/15056)) ([7203b66](https://togithub.com/sequelize/sequelize/commit/7203b6626ed38c06f91f09f73571fb7df56fe348)) ### [`v6.23.1`](https://togithub.com/sequelize/sequelize/releases/tag/v6.23.1) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.23.0...v6.23.1) ##### Bug Fixes - **oracle:** add support for Oracle DB 18c CI ([#15016](https://togithub.com/sequelize/sequelize/issues/15016)) ([5f621d7](https://togithub.com/sequelize/sequelize/commit/5f621d72c1f265bb7659b54eb33469db8a4443fd)), closes [#1](https://togithub.com/sequelize/sequelize/issues/1) [#7](https://togithub.com/sequelize/sequelize/issues/7) [#9](https://togithub.com/sequelize/sequelize/issues/9) [#13](https://togithub.com/sequelize/sequelize/issues/13) [#14](https://togithub.com/sequelize/sequelize/issues/14) [#16](https://togithub.com/sequelize/sequelize/issues/16) ### [`v6.23.0`](https://togithub.com/sequelize/sequelize/releases/tag/v6.23.0) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.22.1...v6.23.0) ##### Features - **types:** add typescript 4.8 compatibility ([#14990](https://togithub.com/sequelize/sequelize/issues/14990)) ([3468378](https://togithub.com/sequelize/sequelize/commit/34683786d7ec832b179845188076ea2121ea78ff)) ### [`v6.22.1`](https://togithub.com/sequelize/sequelize/releases/tag/v6.22.1) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.22.0...v6.22.1) ##### Bug Fixes - **types:** missing type for oracle dialect in v6 ([#14992](https://togithub.com/sequelize/sequelize/issues/14992)) ([1da6657](https://togithub.com/sequelize/sequelize/commit/1da6657de18fc4918dc165f61aedf8888faa3704)), closes [#14991](https://togithub.com/sequelize/sequelize/issues/14991) ### [`v6.22.0`](https://togithub.com/sequelize/sequelize/releases/tag/v6.22.0) [Compare Source](https://togithub.com/sequelize/sequelize/compare/v6.21.6...v6.22.0) ##### Features - **oracle:** add oracle dialect support ([#14638](https://togithub.com/sequelize/sequelize/issues/14638)) ([c230d80](https://togithub.com/sequelize/sequelize/commit/c230d80676450169d9cd74fe4cdf0da261de77b8)), closes [#1](https://togithub.com/sequelize/sequelize/issues/1) [#7](https://togithub.com/sequelize/sequelize/issues/7) [#9](https://togithub.com/sequelize/sequelize/issues/9) [#13](https://togithub.com/sequelize/sequelize/issues/13) [#14](https://togithub.com/sequelize/sequelize/issues/14) [#16](https://togithub.com/sequelize/sequelize/issues/16)Configuration
š Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
š¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.
ā» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
š Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.