Vulnerabilities in pkg:npm/sails-mysql

PACKAGE
Advisory Summary

GHSA-hx5x-49mm-vmhw is a HIGH (CVSS 7.5) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Sails mysql libraries in the npm ecosystem. The issue involves sql injection in sails-mysql. Remediation is available by upgrading affected packages to version 0.10.8.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/sails-mysql

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/sails-mysql. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-hx5x-49mm-vmhw - HIGH SQL Injection in sails-mysql

GHSA-hx5x-49mm-vmhw at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-hx5x-49mm-vmhw
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Sails mysql
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.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/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 High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-hx5x-49mm-vmhw

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

sails-mysql fixed: 0.10.8
npm install sails-mysql@0.10.8
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 sails-mysql

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-hx5x-49mm-vmhw, inspect your project dependencies using npm:

npm ls sails-mysql

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

Note: The npm ls sails-mysql 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-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Sails mysql, 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 `sails-mysql` prior to 0.10.8 are vulnerable to SQL Injection. The `sort` keyword is not properly sanitized and may allow attackers to inject SQL statements and execute arbitrary SQL queries ## Recommendation Upgrade to version 0.10.8 or later.

GHSA-hx5x-49mm-vmhw Affected Sails mysql Versions

1 component(s)
Fixed Versions:
0.10.8
Product / Package Ecosystem Affected Versions Fixed Version
sails-mysql
npm
< 0.10.8
0.10.8

References

Frequently Asked Questions

What is GHSA-hx5x-49mm-vmhw?
GHSA-hx5x-49mm-vmhw is a security vulnerability in Sails mysql involving SQL Injection in sails-mysql under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Sails mysql versions are affected?
Affected versions include releases prior to 0.10.8 across affected packages: sails-mysql.
What version fixes GHSA-hx5x-49mm-vmhw?
Upgrading to 0.10.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sails-mysql affected?
Yes, sails-mysql is affected in releases prior to 0.10.8. Upgrade your dependency to 0.10.8 or later.
What is the CVSS score of GHSA-hx5x-49mm-vmhw?
GHSA-hx5x-49mm-vmhw has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with GHSA-hx5x-49mm-vmhw?
GHSA-hx5x-49mm-vmhw is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check npm dependencies for GHSA-hx5x-49mm-vmhw?
Run the dependency tree command: 'npm ls sails-mysql'. 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-hx5x-49mm-vmhw",
  "modified" : "2021-09-27T22:39:39Z",
  "published" : "2020-09-03T02:36:43Z",
  "aliases" : [ ],
  "summary" : "SQL Injection in sails-mysql",
  "details" : "Versions of `sails-mysql` prior to 0.10.8 are vulnerable to SQL Injection. The `sort` keyword is not properly sanitized and may allow attackers to inject SQL statements and execute arbitrary SQL queries\n\n\n## Recommendation\n\nUpgrade to version 0.10.8 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "sails-mysql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.10.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/balderdashy/sails/issues/6679"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/balderdashy/sails"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-SAILSMYSQL-174916"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/950"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-31T18:41:40Z",
    "nvd_published_at" : null
  }
}