Skip to content

Update dependency sequelize to v6 [SECURITY] - #142

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

renovate[bot] wants to merge 1 commit into
devfrom
renovate/npm-sequelize-vulnerability

Conversation

@renovate

@renovate renovate Bot commented May 28, 2023

Copy link
Copy Markdown

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
sequelize (source) 4.43.06.37.4 age confidence

Denial of Service in sequelize

GHSA-fw4p-36j9-rrj3

More information

Details

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.

Severity

Medium

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Sequelize vulnerable to SQL Injection via replacements

CVE-2023-25813 / GHSA-wrh9-cjv3-2hpw

More information

Details

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

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Sequelize information disclosure vulnerability

CVE-2023-22580 / GHSA-8c25-f3mj-v6h8

More information

Details

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

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Unsafe fall-through in getWhereConditions

CVE-2023-22579 / GHSA-vqfx-gj96-3w95

More information

Details

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: 9.9 / 10 (Critical)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Sequelize - Default support for “raw attributes” when using parentheses

CVE-2023-22578 / GHSA-f598-mfpv-gmfx

More information

Details

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

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


SQL Injection in sequelize

CVE-2019-10752 / GHSA-m9jw-237r-gvfv

More information

Details

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

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


SQL Injection in sequelize

CVE-2019-10748 / GHSA-j9xp-92vc-559j

More information

Details

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

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Sequelize: SQL Injection (Oracle DB)

CVE-2026-69240 / GHSA-v8fg-2rw7-q452

More information

Details

Summary

SQL Injection is possible with strings only if dialect is set to oracle.
The vulnerability was confirmed on Sequelize v6.37.3.

Details

The escape function defined in sql-string.js does not escape quotes if the value starts with TO_TIMESTAMP or TO_DATE.

  } else if (dialect === 'oracle' && typeof val === 'string') {
    if (val.startsWith('TO_TIMESTAMP') || val.startsWith('TO_DATE')) {
      return val;
    }
    val = val.replace(/'/g, "''");
  }
PoC

Suppose the application has the following code:

  var result = await models.Student.findOne({
    where: {
      firstName: req.query.firstName
    }
  });

An attacker can inject arbitrary sql expressions.

http://host/path?firstName=TO_DATE('0','Y')||'' OR 1=1--

The resulted SQL will be:

SELECT ... WHERE "Student"."firstName" = TO_DATE('0','Y')||'' OR 1=1-- ORDER BY "Student"."id" OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY;
Impact

Data theft and tampering.

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

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

sequelize/sequelize (sequelize)

v6.37.4

Compare Source

Bug Fixes

v6.37.3

Compare Source

Bug Fixes
  • postgres: use schema for foreign key constrains of a table (#​17099) (6aba382)

v6.37.2

Compare Source

Bug Fixes

v6.37.1

Compare Source

Bug Fixes

v6.37.0

Compare Source

Features

v6.36.0

Compare Source

Features

v6.35.2

Compare Source

Bug Fixes

v6.35.1

Compare Source

Bug Fixes
  • mssql: allow calling describeTable a table with a dot in its name (#​16769) (47cba67)

v6.35.0

Compare Source

Features

v6.34.0

Compare Source

Bug Fixes
Features

v6.33.0

Compare Source

Bug Fixes
Features

v6.32.1

Compare Source

Bug Fixes

v6.32.0

Compare Source

Bug Fixes
Features

v6.31.1

Compare Source

Bug Fixes
  • postgres: adds support for minifying through join aliases (#​15897) (a9fd501)

v6.31.0

Compare Source

Bug Fixes
Features

v6.30.0

Compare Source

Bug Fixes
Features
  • postgres, sqlite: add conflictWhere option to Model.bulkCreate (#​15788) (295c297)
  • postgres, sqlite: add conflictWhere option to upsert (#​15786) (1e68681)
  • postgres, sqlite: allow override of conflict keys for bulkCreate (#​15787) (2e50bd9)

v6.29.3

Compare Source

Bug Fixes

v6.29.2

Compare Source

Bug Fixes

v6.29.1

Compare Source

Bug Fixes
  • postgres: make sync not fail when trying to create existing enum (#​15718) (1b94462)

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
  • fix typings

Important

✂ PR body was truncated to here.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • 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.


  • 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 ecacb06 to f96fd47 Compare April 23, 2024 22:47
@renovate renovate Bot changed the title Update dependency sequelize to v6 [SECURITY] Update dependency sequelize to v4.44.3 [SECURITY] Apr 23, 2024
@renovate renovate Bot changed the title Update dependency sequelize to v4.44.3 [SECURITY] Update dependency sequelize to v4.44.3 [SECURITY] - autoclosed Aug 2, 2024
@renovate renovate Bot closed this Aug 2, 2024
@renovate
renovate Bot deleted the renovate/npm-sequelize-vulnerability branch August 2, 2024 02:10
@renovate
renovate Bot restored the renovate/npm-sequelize-vulnerability branch August 6, 2024 07:30
@renovate renovate Bot changed the title Update dependency sequelize to v4.44.3 [SECURITY] - autoclosed Update dependency sequelize to v4.44.3 [SECURITY] Aug 6, 2024
@renovate renovate Bot reopened this Aug 6, 2024
@renovate
renovate Bot force-pushed the renovate/npm-sequelize-vulnerability branch from f96fd47 to 20f2adb Compare August 6, 2024 07:32
@renovate renovate Bot changed the title Update dependency sequelize to v4.44.3 [SECURITY] Update dependency sequelize to v4.44.4 [SECURITY] Aug 6, 2024
@renovate
renovate Bot force-pushed the renovate/npm-sequelize-vulnerability branch 2 times, most recently from e0ace33 to 2f9a24e Compare August 13, 2025 11:36
@renovate renovate Bot changed the title Update dependency sequelize to v4.44.4 [SECURITY] Update dependency sequelize to v6 [SECURITY] Aug 13, 2025
@renovate
renovate Bot force-pushed the renovate/npm-sequelize-vulnerability branch from 2f9a24e to b447d91 Compare September 25, 2025 15:47
@renovate
renovate Bot force-pushed the renovate/npm-sequelize-vulnerability branch from b447d91 to 465e81b Compare October 16, 2025 02:05
@renovate renovate Bot changed the title Update dependency sequelize to v6 [SECURITY] Update dependency sequelize to v4.44.4 [SECURITY] Oct 16, 2025
@renovate
renovate Bot force-pushed the renovate/npm-sequelize-vulnerability branch from 465e81b to 64ae6b7 Compare November 18, 2025 09:39
@renovate renovate Bot changed the title Update dependency sequelize to v4.44.4 [SECURITY] Update dependency sequelize to v4.44.4 [SECURITY] - autoclosed Mar 27, 2026
@renovate renovate Bot closed this Mar 27, 2026
@renovate
renovate Bot deleted the renovate/npm-sequelize-vulnerability branch March 27, 2026 01:05
@renovate renovate Bot changed the title Update dependency sequelize to v4.44.4 [SECURITY] - autoclosed Update dependency sequelize to v4.44.4 [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 64ae6b7 to 8e21f17 Compare March 30, 2026 18:07
@renovate renovate Bot changed the title Update dependency sequelize to v4.44.4 [SECURITY] Update dependency sequelize to v4.44.4 [SECURITY] - autoclosed Apr 27, 2026
@renovate renovate Bot closed this Apr 27, 2026
@renovate renovate Bot changed the title Update dependency sequelize to v4.44.4 [SECURITY] - autoclosed Update dependency sequelize to v4.44.4 [SECURITY] Apr 27, 2026
@renovate renovate Bot reopened this Apr 27, 2026
@renovate
renovate Bot force-pushed the renovate/npm-sequelize-vulnerability branch from 8e21f17 to 21fe9b5 Compare April 27, 2026 23:13
@renovate
renovate Bot force-pushed the renovate/npm-sequelize-vulnerability branch from 21fe9b5 to 98bcd6c Compare August 26, 2026 19:14
@renovate renovate Bot changed the title Update dependency sequelize to v4.44.4 [SECURITY] Update dependency sequelize to v6 [SECURITY] Aug 26, 2026
@renovate
renovate Bot force-pushed the renovate/npm-sequelize-vulnerability branch from 98bcd6c to 29389bc Compare September 15, 2026 16:44
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