Vulnerabilities in pkg:npm/sails-mysql
PACKAGEGHSA-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.
pkg:npm/sails-mysql
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
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).
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.
npm install sails-mysql@0.10.8
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
GHSA-hx5x-49mm-vmhw Affected Sails mysql Versions
1 component(s)| 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?
Which Sails mysql versions are affected?
What version fixes GHSA-hx5x-49mm-vmhw?
Is sails-mysql affected?
What is the CVSS score of GHSA-hx5x-49mm-vmhw?
What CWE is associated with GHSA-hx5x-49mm-vmhw?
How can I check npm dependencies for GHSA-hx5x-49mm-vmhw?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}