Skip to content

chore(deps): update dependency sequelize to v6 [security]#119

Open
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/npm-sequelize-vulnerability
Open

chore(deps): update dependency sequelize to v6 [security]#119
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/npm-sequelize-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate bot commented Nov 11, 2019

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
sequelize (source) ^4.0.0^6.0.0 age confidence

GitHub Vulnerability Alerts

CVE-2019-10752

Affected versions of sequelize are vulnerable to SQL Injection. The function sequelize.json() incorrectly formatted sub paths for JSON queries, which allows attackers to inject SQL statements and execute arbitrary SQL queries if user input is passed to the query. Exploitation example:

return User.findAll({
  where: this.sequelize.json("data.id')) AS DECIMAL) = 1 DELETE YOLO INJECTIONS; -- ", 1)
});

Recommendation

If you are using sequelize 5.x, upgrade to version 5.15.1 or later.
If you are using sequelize 4.x, upgrade to version 4.44.3 or later.

Severity
  • CVSS Score: 9.8 / 10 (Critical)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

CVE-2019-10748

Affected versions of sequelize are vulnerable to SQL Injection. The package fails to sanitize JSON path keys in the MariaDB and MySQL dialects, which may allow attackers to inject SQL statements and execute arbitrary SQL queries.

Recommendation

If you are using sequelize 5.x, upgrade to version 5.8.11 or later.
If you are using sequelize 4.x, upgrade to version 4.44.3 or later.
If you are using sequelize 3.x, upgrade to version 3.35.1 or later.

Severity
  • CVSS Score: 9.8 / 10 (Critical)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

CVE-2023-25813

Impact

The SQL injection exploit is related to replacements. Here is such an example:

In the following query, some parameters are passed through replacements, and some are passed directly through the where option.

User.findAll({
  where: or(
    literal('soundex("firstName") = soundex(:firstName)'),
    { lastName: lastName },
  ),
  replacements: { firstName },
})

This is a very legitimate use case, but this query was vulnerable to SQL injection due to how Sequelize processed the query: Sequelize built a first query using the where option, then passed it over to sequelize.query which parsed the resulting SQL to inject all :replacements.

If the user passed values such as

{
  "firstName": "OR true; DROP TABLE users;",
  "lastName": ":firstName"
}

Sequelize would first generate this query:

SELECT * FROM users WHERE soundex("firstName") = soundex(:firstName) OR "lastName" = ':firstName'

Then would inject replacements in it, which resulted in this:

SELECT * FROM users WHERE soundex("firstName") = soundex('OR true; DROP TABLE users;') OR "lastName" = ''OR true; DROP TABLE users;''

As you can see this resulted in arbitrary user-provided SQL being executed.

Patches

The issue was fixed in Sequelize 6.19.1

Workarounds

Do not use the replacements and the where option in the same query if you are not using Sequelize >= 6.19.1

References

See this thread for more information: https://github.com/sequelize/sequelize/issues/14519

Snyk: https://security.snyk.io/vuln/SNYK-JS-SEQUELIZE-2932027

Severity
  • CVSS Score: 10.0 / 10 (Critical)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

CVE-2023-22580

Due to improper input filtering in the sequelize js library, can malicious queries lead to sensitive information disclosure.

Severity
  • CVSS Score: 5.3 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

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:

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

Severity
  • CVSS Score: 10.0 / 10 (Critical)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

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

User.findAll({
  attributes: [
    ['count(id)', 'count']
  ]
});

Produced

SELECT count(id) AS "count" FROM "users"

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 and sequelize@6.29.0.

In Sequelize 7, it now produces the following:

SELECT "count(id)" AS "count" FROM "users"

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

Severity
  • CVSS Score: 10.0 / 10 (Critical)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Release Notes

sequelize/sequelize (sequelize)

v6.29.0

Compare Source

v6.28.2

Compare Source

v6.28.1

Compare Source

v6.28.0

Compare Source

v6.27.0

Compare Source

v6.26.0

Compare Source

v6.25.8

Compare Source

v6.25.7

Compare Source

v6.25.6

Compare Source

v6.25.5

Compare Source

v6.25.4

Compare Source

v6.25.3

Compare Source

v6.25.2

Compare Source

v6.25.1

Compare Source

v6.25.0

Compare Source

v6.24.0

Compare Source

v6.23.2

Compare Source

v6.23.1

Compare Source

v6.23.0

Compare Source

v6.22.1

Compare Source

v6.22.0

Compare Source

v6.21.6

Compare Source

v6.21.5

Compare Source

v6.21.4

Compare Source

v6.21.3

Compare Source

v6.21.2

Compare Source

v6.21.1

Compare Source

v6.21.0

Compare Source

v6.20.1

Compare Source

v6.20.0

Compare Source

v6.19.2

Compare Source

v6.19.1

Compare Source

v6.19.0

Compare Source

v6.18.0

Compare Source

v6.17.0

Compare Source

v6.16.3

Compare Source

v6.16.2

Compare Source

v6.16.1

Compare Source

Bug Fixes

v6.16.0

Compare Source

Features

v6.15.1

Compare Source

Bug Fixes

v6.15.0

Compare Source

Bug Fixes
Features

v6.14.1

Compare Source

Bug Fixes

v6.14.0

Compare Source

Bug Fixes
Features

v6.13.0

Compare Source

Bug Fixes
Features

v6.12.5

Compare Source

Bug Fixes

v6.12.4

Compare Source

Bug Fixes
  • mssql/async-queue: fix unable to start mysql due to circular ref (#​13823) (49e8614)

v6.12.3

Compare Source

Bug Fixes

v6.12.2

Compare Source

Bug Fixes

v6.12.1

Compare Source

Bug Fixes

v6.12.0

Compare Source

Bug Fixes
Features

v6.11.0

Compare Source

Features

v6.10.0

Compare Source

Bug Fixes
Features
  • definitions: Adds AbstractQuery and before/afterQuery hook definitions (#​13635) (37a5858)
  • postgresql: easier SSL config and options param support (#​13673) (9591573)

v6.9.0

Compare Source

Bug Fixes
Features

v6.8.0

Compare Source

Bug Fixes
Features

v6.7.0

Compare Source

Bug Fixes
Features

v6.6.5

Compare Source

Bug Fixes

v6.6.4

Compare Source

Bug Fixes

v6.6.2

Compare Source

Bug Fixes

v6.6.1

Compare Source

Bug Fixes

v6.6.0

Compare Source

Bug Fixes
Features

v6.5.1

Compare Source

Bug Fixes
  • mysql: release connection on deadlocks (#​13102) (6388507)
    • Note: this complements the work done in 6.5.0, fixing another situation not covered by it with MySQL.
  • types: allow transaction to be null (#​13093) (ced4dc7)

v6.5.0

Compare Source

Second release in 2021! 🎉

Bug Fixes
Features

v6.4.0

Compare Source

First release in 2021! 🎉

Bug Fixes
Features

v6.3.5

Compare Source

Bug Fixes
  • truncate: fix missing await in truncate all models with cascade (#​12664) (933b3f6)

v6.3.4

Compare Source

Bug Fixes

v6.3.3

Compare Source

Bug Fixes

v6.3.2

Compare Source

Bug Fixes

v6.3.1

Compare Source

Bug Fixes

v6.3.0

Compare Source

Bug Fixes
Features

v6.2.4

Compare Source

Bug Fixes

v6.2.3

Compare Source

Bug Fixes
  • sqlite: describeTable now returns unique constraint and references (#​12420) (2de3377)

v6.2.2

Compare Source

Bug Fixes
  • types: fixed types for model.init and sequelize.define; update docs (#​12435) (9c446f9)

v6.2.1

Compare Source

Bug Fixes
  • mssql: insert/upsert operations do not return all fields (#​12433) (aeb318a)

v6.2.0

Compare Source

Bug Fixes
Features
  • types: added optional stricter typing for Model attributes (#​12405) (871157b)

v6.1.1

Compare Source

Bug Fixes

v6.1.0: v6

Compare Source

Sequelize v6 is the next major release after v5. Below is a list of breaking changes to help you upgrade.

Breaking Changes

Support for Node 10 and up

Sequelize v6 will only support Node 10 and up #​10821.

CLS

You should now use cls-hooked package for CLS support.

  const cls = require('cls-hooked');
  const namespace = cls.createNamespace('....');
  const Sequelize = require('sequelize');

  Sequelize.useCLS(namespace);
Database Engine Support

We have updated our minimum supported database engine versions. Using older database engine will show SEQUELIZE0006 deprecation warning. Please check ENGINE.md for version table.

Sequelize
  • Bluebird has been removed. Internally all methods are now using async/await. Public API now returns native promises. Thanks to Andy Edwards for this refactor work.
  • Sequelize.Promise is no longer available.
  • sequelize.import method has been removed.
Model
options.returning

Option returning: true will no longer return attributes that are not defined in the model. Old behavior can be achieved by using returning: ['*'] instead.

Model.changed()

This method now tests for equality with _.isEqual and is now deep aware for JSON objects. Modifying a nested value for a JSON object won't mark it as changed (since it is still the same object).

  const instance = await MyModel.findOne();

  instance.myJsonField.someProperty = 12345; // Changed from something else to 12345
  console.log(instance.changed()); // false

  await instance.save(); // this will not save anything

  instance.changed('myJsonField', true);
  console.log(instance.changed()); // ['myJsonField']

  await instance.save(); // will save
Model.bulkCreate()

This method now throws Sequelize.AggregateError instead of Bluebird.AggregateError. All errors are now exposed as errors key.

Model.upsert()

Native upsert is now supported for all dialects.

const [instance, created] = await MyModel.upsert({});

Signature for this method has been changed to Promise<Model,boolean | null>. First index contains upserted instance, second index contains a boolean (or null) indicating if record was created or updated. For SQLite/Postgres, created value will always be null.

  • MySQL - Implemented with ON DUPLICATE KEY UPDATE
  • PostgreSQL - Implemented with ON CONFLICT DO UPDATE
  • SQLite - Implemented with ON CONFLICT DO UPDATE
  • MSSQL - Implemented with MERGE statement

Note for Postgres users: If upsert payload contains PK field, then PK will be used as the conflict target. Otherwise first unique constraint will be selected as the conflict key.

QueryInterface
addConstraint

This method now only takes 2 parameters, tableName and options. Previously the second parameter could be a list of column names to apply the constraint to, this list must now be passed as options.fields property.

Changelog

6.0.0-beta.7
  • docs(associations): belongs to many create with through table
  • docs(query-interface): fix broken links #​12272
  • docs(sequelize): omitNull only works for CREATE/UPDATE queries
  • docs: asyncify #​12297
  • docs: responsive #​12308
  • docs: update feature request template
  • feat(postgres): native upsert #​12301
  • feat(sequelize): allow passing dialectOptions.options from url #​12404
  • fix(include): check if attributes specified for included through model #​12316
  • fix(model.destroy): return 0 with truncate #​12281
  • fix(mssql): empty order array generates invalid FETCH statement #​12261
  • fix(postgres): parse enums correctly when describing a table #​12409
  • fix(query): ensure correct return signature for

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • ""
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from beaa073 to 4b9a793 Compare December 14, 2019 21:55
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 14, 2019

Codecov Report

Merging #119 (5885935) into master (7e6cad0) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master      #119   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           36        36           
  Branches         6         6           
=========================================
  Hits            36        36           

@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 4b9a793 to 79bf19a Compare December 22, 2019 06:56
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 79bf19a to 7ec611a Compare January 18, 2020 14:09
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 7ec611a to 8bc64b6 Compare February 9, 2020 06:00
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 8bc64b6 to c8d928f Compare February 21, 2020 18:28
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch 2 times, most recently from 69b3677 to 1b296c3 Compare May 8, 2020 07:53
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 1b296c3 to 62654c7 Compare July 2, 2020 04:55
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 62654c7 to 7fbbcdf Compare October 26, 2020 03:00
@renovate renovate bot changed the title chore(deps): update dependency sequelize to v4.44.3 [security] chore(deps): update dependency sequelize to v4.44.4 [security] Oct 26, 2020
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 7fbbcdf to 5885935 Compare November 28, 2020 13:00
@renovate renovate bot changed the title chore(deps): update dependency sequelize to v4.44.4 [security] chore(deps): update dependency sequelize to 4.44.4 [security] Apr 26, 2021
@renovate renovate bot changed the title chore(deps): update dependency sequelize to 4.44.4 [security] chore(deps): update dependency sequelize to 6.29.0 [security] Mar 16, 2023
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 0c4be61 to 79d3bfb Compare March 16, 2023 17:48
@renovate renovate bot changed the title chore(deps): update dependency sequelize to 6.29.0 [security] chore(deps): update dependency sequelize to v6 [security] Mar 24, 2023
@renovate renovate bot changed the title chore(deps): update dependency sequelize to v6 [security] chore(deps): update dependency sequelize to v6 [security] - autoclosed Dec 8, 2024
@renovate renovate bot closed this Dec 8, 2024
@renovate renovate bot deleted the renovate/npm-sequelize-vulnerability branch December 8, 2024 18:33
@renovate renovate bot changed the title chore(deps): update dependency sequelize to v6 [security] - autoclosed chore(deps): update dependency sequelize to v6 [security] Dec 8, 2024
@renovate renovate bot reopened this Dec 8, 2024
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 957963a to 79d3bfb Compare December 8, 2024 21:36
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 79d3bfb to a6abb3d Compare August 10, 2025 12:40
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from a6abb3d to 9980a8e Compare September 25, 2025 19:25
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 9980a8e to 67205bc Compare October 21, 2025 18:00
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 67205bc to 910a2aa Compare November 10, 2025 14:56
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 910a2aa to 99dc9c9 Compare November 19, 2025 00:15
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 99dc9c9 to e0c1ff5 Compare December 31, 2025 13:58
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from e0c1ff5 to 7ceb47f Compare January 19, 2026 17:52
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 7ceb47f to a573450 Compare February 2, 2026 19:12
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from a573450 to 975214c Compare February 12, 2026 15:07
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 975214c to 9f0bcd0 Compare March 5, 2026 15:10
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 9f0bcd0 to 6921c39 Compare March 13, 2026 18:06
@renovate renovate bot changed the title chore(deps): update dependency sequelize to v6 [security] chore(deps): update dependency sequelize to v6 [security] - autoclosed Mar 27, 2026
@renovate renovate bot closed this Mar 27, 2026
@renovate renovate bot changed the title chore(deps): update dependency sequelize to v6 [security] - autoclosed chore(deps): update dependency sequelize to v6 [security] Mar 30, 2026
@renovate renovate bot reopened this Mar 30, 2026
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch 2 times, most recently from 6921c39 to fc7fa9b Compare March 30, 2026 22:30
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from fc7fa9b to abfe9c0 Compare April 8, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants