CVE-2017-16047: Hijacked Environment Variables in mysqljs

mysqljs Updated 02 Oct 2025

Summary

01/09/2020
No i
High
7.5

CVE-2017-16047: mysqljs is malware. Affects mysqljs versions >= 0.0.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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The mysqljs package is a popular npm package used for connecting to MySQL databases in Node.js applications. It provides a simple and convenient API for executing SQL queries and managing database connections. However, all versions of the package have been found to contain malware that steals environment variables and sends them to attacker-controlled locations.

Vulnerability Detail

The vulnerability in the mysqljs package allows an attacker to hijack environment variables and exfiltrate sensitive information. When the package is installed and executed, it secretly collects environment variables containing credentials, tokens, and other sensitive data. This data is then sent to the attacker's servers, compromising the security and confidentiality of the affected system. The package has been unpublished from the npm registry to prevent further installations.

How To Fix

No fixed version is published for this vulnerability.

To fix this vulnerability, follow these steps:

  1. Delete the mysqljs package from your project:
    npm uninstall mysqljs
    
  2. Clear your npm cache:
    npm cache clean --force
    
  3. Check if the package is present in any other package.json files on your system and remove it if found.
  4. Regenerate any sensitive credentials, tokens, or registry credentials that may have been exposed.
  5. Review and secure any services that may have been accessed using the compromised environment variables, such as databases or APIs.

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

Conclusion

The mysqljs package has been found to contain malware that steals environment variables, posing a significant security risk to affected systems. If you have this package installed, it is crucial to follow the recommended steps to remove it, clear your npm cache, and secure any exposed credentials. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for mysqljs →

Share this vulnerability

FAQ

The mysqljs package contains malicious code that intercepts and collects environment variables when the package is executed. These environment variables often contain sensitive information such as database credentials, API tokens, and other secrets.

The consequences of this vulnerability can be severe. Attackers can gain unauthorized access to sensitive systems, compromise databases, and steal sensitive data. This can lead to financial loss, reputational damage, and legal consequences.

You can check if the mysqljs package is installed in your environment by running the following command:

npm ls mysqljs

If the package is installed, it will be listed in the output.

No, all versions of the mysqljs package have been unpublished from the npm registry. It is recommended to find an alternative package or library for connecting to MySQL databases in your Node.js applications.

To prevent similar vulnerabilities, it is important to regularly update your packages to the latest versions, use package-lock.json or yarn.lock to ensure deterministic installations, and regularly monitor for security advisories and updates from package maintainers.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

No fixed version is published for this vulnerability.

To fix this vulnerability, follow these steps:

  1. Delete the mysqljs package from your project:
    npm uninstall mysqljs
    
  2. Clear your npm cache:
    npm cache clean --force
    
  3. Check if the package is present in any other package.json files on your system and remove it if found.
  4. Regenerate any sensitive credentials, tokens, or registry credentials that may have been exposed.
  5. Review and secure any services that may have been accessed using the compromised environment variables, such as databases or APIs.

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

Follow Vulert in Google

Get more Vulert vulnerability and dependency-security updates in Google Search and AI results.