SQL Injection Vulnerability in sql

sql Updated 02 Oct 2025

Summary

12/06/2019
MODERATE
No i
Moderate
Not published

GHSA-8f93-rv4p-x4jw: SQL Injection in sql. Affects sql versions < 0.78.0. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The sql package is an npm module used for executing SQL queries in Node.js applications. It provides a convenient way to interact with databases by constructing SQL queries. However, all versions of sql are vulnerable to SQL injection attacks. This vulnerability arises due to improper parameter escaping when building SQL queries.

Vulnerability Detail

The SQL injection vulnerability in sql allows an attacker to manipulate the SQL queries executed by the application. By injecting malicious SQL code, an attacker can bypass authentication, access unauthorized data, modify or delete data, or even execute arbitrary commands on the underlying database. This vulnerability poses a moderate risk to the security and integrity of the application and its associated database.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As there is no fix available, it is advisable to avoid using the sql package until a patch is released. Instead, consider using alternative packages that have proper parameter escaping mechanisms in place. Here's an example of using the mysql package as an alternative:

const mysql = require('mysql');

const connection = mysql.createConnection({
  host: 'localhost',
  user: 'username',
  password: 'password',
  database: 'database_name'
});

connection.connect((err) => {
  if (err) throw err;
  console.log('Connected to the database');
});

const query = 'SELECT * FROM users WHERE id = ?';
const userId = 1;

connection.query(query, userId, (err, results) => {
  if (err) throw err;
  console.log(results);
});

connection.end();

Conclusion

The sql package is vulnerable to SQL injection attacks, which can have severe consequences for the security and integrity of your application and its associated database. It is recommended to avoid using this package until a fix is provided. Consider using alternative packages that have proper parameter escaping mechanisms in place. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for sql →

Share this vulnerability

FAQ

SQL injection is a type of security vulnerability where an attacker can insert malicious SQL code into a query, manipulating its behavior and potentially gaining unauthorized access to data or executing arbitrary commands.

The SQL injection vulnerability in sql allows attackers to manipulate the SQL queries executed by your application. This can lead to unauthorized access to sensitive data, data modification or deletion, and even execution of arbitrary commands on the underlying database.

Currently, there is no fix available for this vulnerability in the sql package. It is recommended to avoid using this package until a fix is provided by the maintainers.

As a workaround, it is advisable to use alternative packages that properly escape parameters to prevent SQL injection attacks. The mysql package is one such alternative.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply upload your package-lock.json file and it will analyze the dependencies for any known vulnerabilities.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback