Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update peerdependency sequelize to v6 [security] #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Nov 11, 2019

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
sequelize (source) ^4.41 -> ^6.29.0 age adoption passing confidence
sequelize (source) 4.41.0 -> 6.29.0 age adoption passing 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.

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.

GHSA-fw4p-36j9-rrj3

Versions of sequelize prior to 4.44.4 are vulnerable to Denial of Service (DoS). The SQLite dialect fails to catch a TypeError exception for the results variable. The results value may be undefined and trigger the error on a .map call. This may allow attackers to submit malicious input that forces the exception and crashes the Node process.

The following proof-of-concept crashes the Node process:

const Sequelize = require('sequelize');

const sequelize = new Sequelize({
	dialect: 'sqlite',
	storage: 'database.sqlite'
});

const TypeError = sequelize.define('TypeError', {
	name: Sequelize.STRING,
});

TypeError.sync({force: true}).then(() => {
	return TypeError.create({name: "SELECT tbl_name FROM sqlite_master"});
});

Recommendation

Upgrade to version 4.44.4 or later.

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

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:

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

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


Release Notes

sequelize/sequelize (sequelize)

v6.29.0

Compare Source

Features

v6.28.2

Compare Source

Bug Fixes

v6.28.1

Compare Source

Bug Fixes

v6.28.0

Compare Source

Features
  • types: use retry-as-promised types for retry options to match documentation (#​15484) (fd4afa6)

v6.27.0

Compare Source

Features

v6.26.0

Compare Source

Features

v6.25.8

Compare Source

Bug Fixes

v6.25.7

Compare Source

Bug Fixes

v6.25.6

Compare Source

Bug Fixes

v6.25.5

Compare Source

Bug Fixes

v6.25.4

Compare Source

Bug Fixes

v6.25.3

Compare Source

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) (7990095), closes #​14700

v6.25.2

Compare Source

Bug Fixes
  • types: fix TS 4.9 excessive depth error on InferAttributes (v6) (#​15135) (851daaf)

v6.25.1

Compare Source

Bug Fixes

v6.25.0

Compare Source

Features

v6.24.0

Compare Source

Features
  • snowflake: Add support for QueryGenerator#tableExistsQuery (#​15087) (a44772e)

v6.23.2

Compare Source

Bug Fixes
  • postgres: add custom order direction to subQuery ordering with minified alias (#​15056) (7203b66)

v6.23.1

Compare Source

Bug Fixes

v6.23.0

Compare Source

Features

v6.22.1

Compare Source

Bug Fixes

v6.22.0

Compare Source

Features

v6.21.6

Compare Source

Bug Fixes

v6.21.5

Compare Source

Bug Fixes

v6.21.4

Compare Source

Bug Fixes

v6.21.3

Compare Source

Bug Fixes
  • postgres: attach postgres error-handler earlier in lifecycle (v6) (#​14731) (90bb694)

v6.21.2

Compare Source

Bug Fixes

v6.21.1

Compare Source

Bug Fixes

v6.21.0

Compare Source

Features
  • exports types to support typescript >= 4.5 nodenext module (#​14620) (cbdf73e)

v6.20.1

Compare Source

Bug Fixes

v6.20.0

Compare Source

Features

v6.19.2

Compare Source

Bug Fixes

v6.19.1

Compare Source

Bug Fixes

⚠️ BREAKING CHANGE: This change is a security fix that patches a serious SQL injection vulnerability, however it is possible that your application made use of it and broke as a result of this change. Please see this issue for more information.

v6.19.0

Compare Source

Bug Fixes
Features
  • types: make Model.init aware of pre-configured foreign keys (#​14370) (5954d2c)

v6.18.0

Compare Source

Features
  • add whereScopeStrategy to merge where scopes with Op.and (#​14152) (8349c02)

v6.17.0

Compare Source

Bug Fixes
Features

v6.16.3

Compare Source

Bug Fixes

v6.16.2

Compare Source

Bug Fixes

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
  • mysql, mariadb: release connection on deadlocks (#​12841) (c77b1f3)
  • types: allow changing values on befo

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 these updates 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 11fb72b to 7266b3e Compare November 21, 2019 13:29
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 7266b3e to f856c7b Compare December 14, 2019 18:54
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from f856c7b to db33c74 Compare December 22, 2019 01:00
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from db33c74 to f65b458 Compare December 30, 2019 23:55
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from f65b458 to 40f5011 Compare May 8, 2020 03:59
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 40f5011 to 0707672 Compare July 1, 2020 16:47
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 0707672 to 464dd73 Compare October 29, 2020 03:58
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize [security] chore(deps): update peerdependency sequelize to v4.44.4 [security] Oct 29, 2020
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 464dd73 to 25e9f4a Compare March 19, 2023 02:08
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize to v4.44.4 [security] chore(deps): update peerdependency sequelize [security] Mar 19, 2023
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 25e9f4a to 72565d0 Compare March 25, 2023 03:36
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize [security] chore(deps): update peerdependency sequelize to v6 [security] Mar 25, 2023
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 72565d0 to 88498ee Compare April 3, 2023 10:58
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize to v6 [security] chore(deps): update peerdependency sequelize [security] Apr 3, 2023
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize [security] chore(deps): update peerdependency sequelize to v6 [security] Apr 3, 2023
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 88498ee to 7b9ba2b Compare April 3, 2023 13:52
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 7b9ba2b to 3960bd5 Compare April 17, 2023 13:15
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize to v6 [security] chore(deps): update peerdependency sequelize [security] Apr 17, 2023
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 3960bd5 to a67d5f5 Compare April 17, 2023 15:50
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize [security] chore(deps): update peerdependency sequelize to v6 [security] Apr 17, 2023
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from a67d5f5 to 09033cf Compare May 28, 2023 08:48
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize to v6 [security] chore(deps): update peerdependency sequelize [security] May 28, 2023
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 09033cf to 4297075 Compare May 28, 2023 12:36
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize [security] chore(deps): update peerdependency sequelize to v6 [security] May 28, 2023
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 4297075 to f7f2e72 Compare May 31, 2023 11:07
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize to v6 [security] chore(deps): update peerdependency sequelize [security] May 31, 2023
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from f7f2e72 to e33db54 Compare May 31, 2023 14:02
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize [security] chore(deps): update peerdependency sequelize to v6 [security] May 31, 2023
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from e33db54 to ba37ca3 Compare June 4, 2023 12:41
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize to v6 [security] chore(deps): update peerdependency sequelize [security] Jun 4, 2023
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 8903db9 to 1685525 Compare May 1, 2024 17:41
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize to v6 [security] chore(deps): update peerdependency sequelize [security] May 1, 2024
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 1685525 to 148d348 Compare May 1, 2024 20:30
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize [security] chore(deps): update peerdependency sequelize to v6 [security] May 1, 2024
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 148d348 to 3131ced Compare May 9, 2024 08:05
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize to v6 [security] chore(deps): update peerdependency sequelize [security] May 9, 2024
Copy link
Author

renovate bot commented May 9, 2024

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: yarn.lock
[16:10:28.397] INFO (66): Installing tool node@8.12.0...
[16:10:37.745] WARN (66): Npm error:
npm ERR! weird error 1
[16:10:37.772] FATAL (66): Cannot delete files/directories outside the current working directory. Can be overridden with the `force` option.
    err: {
      "type": "Error",
      "message": "Cannot delete files/directories outside the current working directory. Can be overridden with the `force` option.",
      "stack":
          Error: Cannot delete files/directories outside the current working directory. Can be overridden with the `force` option.
              at safeCheck (/snapshot/dist/containerbase-cli.js:40911:11)
              at mapper (/snapshot/dist/containerbase-cli.js:40947:7)
              at /snapshot/dist/containerbase-cli.js:40850:31
              at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    }
[16:10:38.506] INFO (66): Installed tool node with errors in 10.1s.

@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 3131ced to 5767602 Compare May 9, 2024 11:19
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize [security] chore(deps): update peerdependency sequelize to v6 [security] May 9, 2024
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 5767602 to b2c6920 Compare May 15, 2024 17:26
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize to v6 [security] chore(deps): update peerdependency sequelize [security] May 15, 2024
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from b2c6920 to 358e906 Compare May 16, 2024 00:13
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize [security] chore(deps): update peerdependency sequelize to v6 [security] May 16, 2024
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 358e906 to e599815 Compare June 4, 2024 10:13
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize to v6 [security] chore(deps): update peerdependency sequelize [security] Jun 4, 2024
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from e599815 to 11d0217 Compare June 4, 2024 14:02
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize [security] chore(deps): update peerdependency sequelize to v6 [security] Jun 4, 2024
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 11d0217 to 99d88be Compare June 27, 2024 10:36
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize to v6 [security] chore(deps): update peerdependency sequelize [security] Jun 27, 2024
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 99d88be to bc2ea1d Compare June 27, 2024 13:07
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize [security] chore(deps): update peerdependency sequelize to v6 [security] Jun 27, 2024
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from bc2ea1d to 1d2378b Compare July 14, 2024 09:57
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize to v6 [security] chore(deps): update peerdependency sequelize [security] Jul 14, 2024
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 1d2378b to 0b653a5 Compare July 14, 2024 13:21
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize [security] chore(deps): update peerdependency sequelize to v6 [security] Jul 14, 2024
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from 0b653a5 to ca80634 Compare July 21, 2024 13:07
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize to v6 [security] chore(deps): update peerdependency sequelize [security] Jul 21, 2024
@renovate renovate bot force-pushed the renovate/npm-sequelize-vulnerability branch from ca80634 to 26e7d77 Compare July 21, 2024 16:10
@renovate renovate bot changed the title chore(deps): update peerdependency sequelize [security] chore(deps): update peerdependency sequelize to v6 [security] Jul 21, 2024
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.

None yet

0 participants