Vulnerabilities in pkg:npm/sql

PACKAGE
Advisory Summary

GHSA-8f93-rv4p-x4jw is a MODERATE sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Sql libraries in the npm ecosystem. The issue involves sql injection in sql. Remediation is available in the latest vendor maintenance releases.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/sql

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-8f93-rv4p-x4jw - MODERATE SQL Injection in sql

GHSA-8f93-rv4p-x4jw at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-8f93-rv4p-x4jw
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Sql
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-8f93-rv4p-x4jw

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

sql fixed: Latest secure release
npm install sql@Latest secure release
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 sql

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-8f93-rv4p-x4jw, inspect your project dependencies using npm:

npm ls sql

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

Note: The npm ls sql 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 Sql, 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

All versions of `sql` are vulnerable to sql injection as it does not properly escape parameters when building SQL queries. ## Recommendation No fix is currently available for this vulnerability. It is our recommendation to not install or use this module until a fix is available.

GHSA-8f93-rv4p-x4jw Affected Sql Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
sql
npm
≤ 0.78.0

References

Frequently Asked Questions

What is GHSA-8f93-rv4p-x4jw?
GHSA-8f93-rv4p-x4jw is a security vulnerability in Sql involving SQL Injection in sql under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Sql versions are affected?
Affected versions include releases prior to current release patches across affected packages: sql.
What version fixes GHSA-8f93-rv4p-x4jw?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is sql affected?
Yes, sql is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-8f93-rv4p-x4jw?
GHSA-8f93-rv4p-x4jw 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-8f93-rv4p-x4jw?
Run the dependency tree command: 'npm ls sql'. 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-8f93-rv4p-x4jw",
  "modified" : "2020-08-31T18:31:48Z",
  "published" : "2019-06-12T16:36:52Z",
  "aliases" : [ ],
  "summary" : "SQL Injection in sql",
  "details" : "All versions of `sql` are vulnerable to sql injection as it does not properly escape parameters when building SQL queries.\n\n\n## Recommendation\n\nNo fix is currently available for this vulnerability. It is our recommendation to not install or use this module until a fix is available.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "sql"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.78.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/319465"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/662"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2019-06-12T16:36:34Z",
    "nvd_published_at" : null
  }
}