Critical Malicious Code Vulnerability in @bdkinc/knex-ibmi Package
Summary
MAL-2025-191192: Malicious code in @bdkinc/knex-ibmi (npm). Affects @bdkinc/knex-ibmi versions 0.5.7. No fix is published. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
The @bdkinc/knex-ibmi package is a Node.js library designed to facilitate database interactions with IBM i systems using Knex.js. It provides a set of tools for building SQL queries and managing database connections. However, this package has been compromised, leading to severe security risks for users who have it installed.
Vulnerability Detail
The vulnerability originates from a malicious payload introduced by the Sha1-Hulud: The Second Coming NPM worm. This malware is capable of stealing tokens and credentials, publishing them to GitHub, and propagating itself to other NPM packages owned by the user. Additionally, it may destroy the user's home directory, leading to a complete compromise of the affected system. Any computer with this package installed should be considered fully compromised.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall @bdkinc/knex-ibmi
If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
There are no effective workarounds for this vulnerability. The best course of action is to remove the package and ensure that no remnants of the malicious code remain on the system.
Conclusion
The @bdkinc/knex-ibmi package has been compromised, leading to significant security risks for users. Immediate action is required to remove the package and secure any sensitive information. Regular monitoring for vulnerabilities using tools like Vulert can help prevent future incidents.
See every vulnerability recorded for @bdkinc/knex-ibmi →
FAQ
You should immediately remove the package and rotate any secrets or keys stored on your system.
The malicious code can steal sensitive information, propagate to other packages, and potentially destroy your home directory.
Recovery involves removing the package, rotating all credentials, and possibly reinstalling your operating system to ensure no malicious remnants remain.
Yes, you can use Vulert, which monitors and alerts for open-source vulnerabilities using just your package-lock.json file. You can check your application at Vulert Scanner.
If a patched version is released, updating the package will help, but it is still essential to remove the compromised version and secure your system.