GHSA-fw4p-36j9-rrj3: Sequelize Denial of Service Vulnerability

MODERATE
CWE-248
Published
Advisory Summary

GHSA-fw4p-36j9-rrj3 is a MODERATE denial of service vulnerability (CWE-248: Uncaught Exception) affecting Sequelize libraries in the npm ecosystem. The issue involves denial of service in sequelize. Remediation is available by upgrading affected packages to version 4.44.4.

GHSA-fw4p-36j9-rrj3 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-fw4p-36j9-rrj3
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-248: Uncaught Exception
Affected Product Sequelize
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-fw4p-36j9-rrj3

To remediate this vulnerability, upgrade all affected Sequelize dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

sequelize fixed: 4.44.4
npm install sequelize@4.44.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls sequelize

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-fw4p-36j9-rrj3, inspect your project dependencies using npm:

npm ls sequelize

Analyze the terminal output to locate any version of Sequelize in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.44.4), your application is affected.

Note: The npm ls sequelize command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-248: Uncaught Exception, where an exception is thrown from a function, but it is not caught. In Sequelize, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

GHSA-fw4p-36j9-rrj3 Affected Sequelize Versions

1 component(s)
Fixed Versions:
4.44.4
Product / Package Ecosystem Affected Versions Fixed Version
sequelize
npm
< 4.44.4
4.44.4

References

Frequently Asked Questions

What is GHSA-fw4p-36j9-rrj3?
GHSA-fw4p-36j9-rrj3 is a security vulnerability in Sequelize involving Denial of Service in sequelize under CWE-248: Uncaught Exception.
Which Sequelize versions are affected?
Affected versions include releases prior to 4.44.4 across affected packages: sequelize.
What version fixes GHSA-fw4p-36j9-rrj3?
Upgrading to 4.44.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sequelize affected?
Yes, sequelize is affected in releases prior to 4.44.4. Upgrade your dependency to 4.44.4 or later.
What CWE is associated with GHSA-fw4p-36j9-rrj3?
GHSA-fw4p-36j9-rrj3 is classified under CWE-248: Uncaught Exception (An exception is thrown from a function, but it is not caught.).
How can I check npm dependencies for GHSA-fw4p-36j9-rrj3?
Run the dependency tree command: 'npm ls sequelize'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-fw4p-36j9-rrj3",
  "modified" : "2020-08-31T18:48:48Z",
  "published" : "2020-09-03T20:25:33Z",
  "aliases" : [ ],
  "summary" : "Denial of Service in sequelize",
  "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.  \n\nThe following proof-of-concept crashes the Node process:  \n```\nconst Sequelize = require('sequelize');\n\nconst sequelize = new Sequelize({\n\tdialect: 'sqlite',\n\tstorage: 'database.sqlite'\n});\n\nconst TypeError = sequelize.define('TypeError', {\n\tname: Sequelize.STRING,\n});\n\nTypeError.sync({force: true}).then(() => {\n\treturn TypeError.create({name: \"SELECT tbl_name FROM sqlite_master\"});\n});\n```\n\n\n## Recommendation\n\nUpgrade to version 4.44.4 or later.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "sequelize"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.44.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sequelize/sequelize/pull/11877"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/1142"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-248" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-31T18:48:48Z",
    "nvd_published_at" : null
  }
}