CVE-2019-11069: Sequelize SQL Injection Vulnerability

HIGH
Advisory Identifier: GHSA-2777-2vq8-c4v4
CVSS 7.5
CWE-20
Published
Advisory Summary

CVE-2019-11069 is a HIGH (CVSS 7.5) sql injection vulnerability (CWE-20: Improper Input Validation) affecting Sequelize libraries in the npm ecosystem. The issue involves sql injection in sequelize. Remediation is available by upgrading affected packages to version 5.3.0.

CVE-2019-11069 at a Glance

CVE Identifier CVE-2019-11069
GHSA Identifier GHSA-2777-2vq8-c4v4
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-20: Improper Input Validation
Affected Product Sequelize
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2019-11069

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: 5.3.0
npm install sequelize@5.3.0
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 CVE-2019-11069, 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 5.3.0), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. 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 5.3.0 (excluding v3 and v4) are vulnerable to SQL Injection. PostgreSQL option`standard_conforming_strings` is not set to `on` by default, which may allow attackers to inject SQL statements due to poor handling of backslashes in string literals. ## Recommendation Upgrade to version 5.3.0 or later.

CVE-2019-11069 Affected Sequelize Versions

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

References

Frequently Asked Questions

What is CVE-2019-11069?
CVE-2019-11069 is a security vulnerability in Sequelize involving SQL Injection in sequelize under CWE-20: Improper Input Validation.
Which Sequelize versions are affected?
Affected versions include releases prior to 5.3.0 across affected packages: sequelize.
What version fixes CVE-2019-11069?
Upgrading to 5.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sequelize affected?
Yes, sequelize is affected in releases prior to 5.3.0. Upgrade your dependency to 5.3.0 or later.
What is the CVSS score of CVE-2019-11069?
CVE-2019-11069 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2019-11069?
CVE-2019-11069 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check npm dependencies for CVE-2019-11069?
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-2777-2vq8-c4v4",
  "modified" : "2023-11-20T22:07:00Z",
  "published" : "2019-04-11T16:33:17Z",
  "aliases" : [ "CVE-2019-11069" ],
  "summary" : "SQL Injection in sequelize",
  "details" : "Versions of `sequelize` prior to 5.3.0 (excluding v3 and v4) are vulnerable to SQL Injection. PostgreSQL option`standard_conforming_strings` is not set to `on` by default, which may allow attackers to inject SQL statements due to poor handling of backslashes in string literals.\n\n\n## Recommendation\n\nUpgrade to version 5.3.0 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "sequelize"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.3.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-11069"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sequelize/sequelize/pull/10746"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sequelize/sequelize/pull/10746/files"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sequelize/sequelize/commit/850c7fd04669e0fef9238b6dc4f8d6ee93ed71e9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sequelize/sequelize"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sequelize/sequelize/blob/98cb17c17f73e2aa1792aa5a1d31216ba984b456/lib/dialects/postgres/connection-manager.js#L158-L160"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sequelize/sequelize/releases/tag/v5.3.0"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-SEQUELIZE-174167"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T20:51:40Z",
    "nvd_published_at" : "2019-04-10T21:29:01Z"
  }
}