Vulnerabilities in pkg:npm/connect-pg-simple
PACKAGECVE-2019-15658 is a HIGH (CVSS 7.3) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Connect pg simple libraries in the npm ecosystem. The issue involves sql injection in connect-pg-simple. Remediation is available by upgrading affected packages to version 6.0.1.
pkg:npm/connect-pg-simple
Vulnerability advisories affecting package pkg:npm/connect-pg-simple. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-xqh8-5j36-4556 | CVE-2019-15658 | HIGH | SQL Injection in connect-pg-simple |
CVE-2019-15658 at a Glance
Security Impact
CVSS: 7.3
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:L/I:L/A:L).
How to Fix CVE-2019-15658
To remediate this vulnerability, upgrade all affected Connect pg simple 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 connect-pg-simple@6.0.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls connect-pg-simple
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2019-15658, inspect your project dependencies using npm:
npm ls connect-pg-simple
Analyze the terminal output to locate any version of Connect pg simple in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.0.1), your application is affected.
Note: The npm ls connect-pg-simple 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 Connect pg simple, 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
CVE-2019-15658 Affected Connect pg simple Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
connect-pg-simple
|
npm |
< 6.0.1
|
6.0.1
|
References
Frequently Asked Questions
What is CVE-2019-15658?
Which Connect pg simple versions are affected?
What version fixes CVE-2019-15658?
Is connect-pg-simple affected?
What is the CVSS score of CVE-2019-15658?
What CWE is associated with CVE-2019-15658?
How can I check npm dependencies for CVE-2019-15658?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xqh8-5j36-4556",
"modified" : "2022-06-15T18:39:04Z",
"published" : "2019-08-26T16:59:45Z",
"aliases" : [ "CVE-2019-15658" ],
"summary" : "SQL Injection in connect-pg-simple",
"details" : "### Impact\nAn unlikely SQL injection if the case of an unsanitized table name input.\n\n### Patches\nThe user should upgrade to `6.0.1`. Due to its low impact a backport has not been made to the `5.x` branch.\n\n### Workarounds\nIf there is no likelihood that the `tableName` or `schemaName` options sent to the constructor could be of an unsanitized nature, then no workaround is needed. Else the input could be sanitized and escaped before sending it in. Take note though that such an escaping would need to be removed when upgrading to `6.0.1` or later, to avoid double escaping.\n\n### References\n* [Security issue disclosure](https://github.com/voxpelli/node-connect-pg-simple/issues/151)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [voxpelli/node-connect-pg-simple](https://github.com/voxpelli/node-connect-pg-simple)\n* Email maintainer at [pelle@kodfabrik.se](mailto:pelle@kodfabrik.se)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "connect-pg-simple"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "6.0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/voxpelli/node-connect-pg-simple/security/advisories/GHSA-xqh8-5j36-4556"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-15658"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-xqh8-5j36-4556"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/voxpelli/node-connect-pg-simple"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-CONNECTPGSIMPLE-460154"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/1153"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T22:04:11Z",
"nvd_published_at" : null
}
}