sequelize
Ecosystem: npm
Downloads: 12.94 Mln
- 9CriticalAffects 12 versions
- 7HighAffects 7 versions
- 0MediumAffects 0 versions
- 3ModerateAffects 3 versions
- 0LowAffects 0 versions
- Critical9 (47.4%)
- High7 (36.8%)
- Medium0 (0.0%)
- Moderate3 (15.8%)
- Low0 (0.0%)
Monthly breakdown
- Critical
- High
- Medium
- Moderate
- Low
- 1 vulnerabilities
- Critical: 1
- High: 0
- Medium: 0
- Moderate: 0
- Low: 0
- 1 vulnerabilities
- Critical: 0
- High: 1
- Medium: 0
- Moderate: 0
- Low: 0
- 5 vulnerabilities
- Critical: 4
- High: 0
- Medium: 0
- Moderate: 1
- Low: 0
- 2 vulnerabilities
- Critical: 1
- High: 0
- Medium: 0
- Moderate: 1
- Low: 0
- 2 vulnerabilities
- Critical: 2
- High: 0
- Medium: 0
- Moderate: 0
- Low: 0
- 1 vulnerabilities
- Critical: 1
- High: 0
- Medium: 0
- Moderate: 0
- Low: 0
- 1 vulnerabilities
- Critical: 0
- High: 1
- Medium: 0
- Moderate: 0
- Low: 0
- 1 vulnerabilities
- Critical: 0
- High: 1
- Medium: 0
- Moderate: 0
- Low: 0
- 4 vulnerabilities
- Critical: 0
- High: 3
- Medium: 0
- Moderate: 1
- Low: 0
- 1 vulnerabilities
- Critical: 0
- High: 1
- Medium: 0
- Moderate: 0
- Low: 0
Vulnerabilities (19)
Known vulnerabilities affecting sequelize, based on data from OSV.
| ID | Severity | Summary | Affected versions | Published | Source |
|---|---|---|---|---|---|
| GHSA-v8fg-2rw7-q452 | Critical | Sequelize: SQL Injection (Oracle DB)### 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`. ```javascript } 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: ```javascript var result = await models |
| GitHub (opens in a new tab) | |
| GHSA-6457-6jrx-69cr | High | Sequelize v6 Vulnerable to SQL Injection via JSON Column Cast Type### Summary SQL injection via unescaped cast type in JSON/JSONB `where` clause processing. The `_traverseJSON()` function splits JSON path keys on `::` to extract a cast type, which is interpolated raw into `CAST(... AS <type>)` SQL. An attacker who controls JSON object keys can inject arbitrary SQL and exfiltrate data from any table. Affected: v6.x through 6.37.7. v7 (`@sequelize/core`) is not affected. ### Details In `src/dialects/abstract/query-generator.js`, `_traverseJSON()` extracts a cast type from `::` in JSON keys without validation: ```javascript // line 1892 _traverseJSON(items |
| GitHub (opens in a new tab) | |
| GHSA-f598-mfpv-gmfx | Critical | Sequelize - Default support for “raw attributes” when using parentheses### 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 ```ts User.findAll({ attributes: [ ['count(id)', 'count'] ] }); ``` Produced ```sql 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`](https://github.com/sequelize/sequelize/pull/15374) and [`sequelize@6.29.0`](https://github.com/sequelize/sequelize/pull/15710). |
| GitHub (opens in a new tab) | |
| GHSA-vqfx-gj96-3w95 | Critical | Unsafe fall-through in getWhereConditions### 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: ```ts 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`](https://github.com/sequelize/sequelize/pull/15699) & [`@sequelize/core@7.0.0.alpha-20`](https://github.com/sequelize/sequelize/pull/15375) ### Reference |
| GitHub (opens in a new tab) | |
| GHSA-wrh9-cjv3-2hpw | Critical | Sequelize vulnerable to SQL Injection via replacements### 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. ```typescript 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 |
| GitHub (opens in a new tab) | |
| GHSA-8c25-f3mj-v6h8 | Moderate | Sequelize information disclosure vulnerabilityDue to improper input filtering in the sequelize js library, can malicious queries lead to sensitive information disclosure. |
| GitHub (opens in a new tab) | |
| GHSA-8mwq-mj73-qv68 | Critical | Duplicate advisory: Sequelize vulnerable to Improper Filtering of Special Elements## Duplicate advisory This advisory has been withdrawn because it is a duplicate of [GHSA-f598-mfpv-gmfx](https://github.com/advisories/GHSA-f598-mfpv-gmfx). This link is maintained to preserve external references. ## Original Description Due to improper attribute filtering in the sequelize js library, an attacker can peform SQL injections. This issue can be mitigated by not accepting untrusted input. |
| GitHub (opens in a new tab) | |
| GHSA-fw4p-36j9-rrj3 | Moderate | Denial of Service in sequelizeVersions 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', { na |
| GitHub (opens in a new tab) | |
| GHSA-5v9h-q3gj-c32x | Critical | SQL Injection via GeoJSON in sequelizeAffected versions of `sequelize` are vulnerable to SQL Injection in Models that have fields with the `GEOMETRY` DataType. This vulnerability occurs because single quotes in document values are not escaped for GeoJSON documents using `ST_GeomFromGeoJSON`, and MySQL GeoJSON documents using `GeomFromText`. ## Recommendation Update to version 3.23.6 or later. |
| GitHub (opens in a new tab) | |
| GHSA-2598-2f59-rmhq | Critical | SQL Injection in sequelizeVersions of `sequelize` prior to 3.35.1 are vulnerable to SQL Injection. The package fails to sanitize JSON path keys in the Postgres dialect, which may allow attackers to inject SQL statements and execute arbitrary SQL queries. ## Recommendation Upgrade to version 3.35.1 or later. |
| GitHub (opens in a new tab) |
### 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`. ```javascript } 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: ```javascript var result = await models
CVE: CVE-2026-69240
- GHSA-6457-6jrx-69crHighSequelize v6 Vulnerable to SQL Injection via JSON Column Cast Type
>= 6.0.0-beta.1, < 6.37.8
### Summary SQL injection via unescaped cast type in JSON/JSONB `where` clause processing. The `_traverseJSON()` function splits JSON path keys on `::` to extract a cast type, which is interpolated raw into `CAST(... AS <type>)` SQL. An attacker who controls JSON object keys can inject arbitrary SQL and exfiltrate data from any table. Affected: v6.x through 6.37.7. v7 (`@sequelize/core`) is not affected. ### Details In `src/dialects/abstract/query-generator.js`, `_traverseJSON()` extracts a cast type from `::` in JSON keys without validation: ```javascript // line 1892 _traverseJSON(items
CVE: CVE-2026-30951
- GHSA-f598-mfpv-gmfxCriticalSequelize - Default support for “raw attributes” when using parentheses
< 6.29.0
### 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 ```ts User.findAll({ attributes: [ ['count(id)', 'count'] ] }); ``` Produced ```sql 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`](https://github.com/sequelize/sequelize/pull/15374) and [`sequelize@6.29.0`](https://github.com/sequelize/sequelize/pull/15710).
CVE: CVE-2023-22578
- GHSA-vqfx-gj96-3w95CriticalUnsafe fall-through in getWhereConditions
< 6.28.1
### 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: ```ts 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`](https://github.com/sequelize/sequelize/pull/15699) & [`@sequelize/core@7.0.0.alpha-20`](https://github.com/sequelize/sequelize/pull/15375) ### Reference
CVE: CVE-2023-22579
- GHSA-wrh9-cjv3-2hpwCriticalSequelize vulnerable to SQL Injection via replacements
< 6.19.1
### 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. ```typescript 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
CVE: CVE-2023-25813
- GHSA-8c25-f3mj-v6h8ModerateSequelize information disclosure vulnerability
< 6.28.1
Due to improper input filtering in the sequelize js library, can malicious queries lead to sensitive information disclosure.
CVE: CVE-2023-22580
- GHSA-8mwq-mj73-qv68CriticalDuplicate advisory: Sequelize vulnerable to Improper Filtering of Special Elements
< 6.29.0
## Duplicate advisory This advisory has been withdrawn because it is a duplicate of [GHSA-f598-mfpv-gmfx](https://github.com/advisories/GHSA-f598-mfpv-gmfx). This link is maintained to preserve external references. ## Original Description Due to improper attribute filtering in the sequelize js library, an attacker can peform SQL injections. This issue can be mitigated by not accepting untrusted input.
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', { na
- GHSA-5v9h-q3gj-c32xCriticalSQL Injection via GeoJSON in sequelize
>= 3.4.0, < 3.23.6
Affected versions of `sequelize` are vulnerable to SQL Injection in Models that have fields with the `GEOMETRY` DataType. This vulnerability occurs because single quotes in document values are not escaped for GeoJSON documents using `ST_GeomFromGeoJSON`, and MySQL GeoJSON documents using `GeomFromText`. ## Recommendation Update to version 3.23.6 or later.
CVE: CVE-2016-1000225
Versions of `sequelize` prior to 3.35.1 are vulnerable to SQL Injection. The package fails to sanitize JSON path keys in the Postgres dialect, which may allow attackers to inject SQL statements and execute arbitrary SQL queries. ## Recommendation Upgrade to version 3.35.1 or later.
CVE: CVE-2019-10749