Malicious code in ts-bn-lint-helper (npm)
Description
The npm package ts-bn-lint-helper masquerades as a TypeScript lint helper but contains malicious code that harvests sensitive files and shell history from the user's environment. It recursively searches the current working directory for configuration and credential files and exfiltrates them, along with shell history files, to an attacker-controlled server. The package uses base64 encoding to hide the exfiltration URL and target file patterns. Execution of the from_str() function or running npm test triggers the data theft. The package metadata is minimal and deceptive, mimicking legitimate tooling to avoid detection.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The ts-bn-lint-helper npm package version 3.1.19 contains embedded malicious code in its index.js file that, when invoked, recursively scans the current working directory for files named id.json, config.toml, Config.toml, config.json, env, and .env, and uploads them to a remote server via an axios POST request. It also harvests shell history from common shell history files such as ~/.bash_history, ~/.zsh_history, fish history, ~/.sh_history, and PowerShell's PSReadLine ConsoleHost_history.txt, using fallback shell commands executed via execSync if necessary. The exfiltration URL and file patterns are base64-encoded to evade simple detection. The malicious function from_str() is automatically called during npm test execution. The package metadata is sparse and designed to appear legitimate, increasing the risk of unsuspecting developers installing and running it.
Potential Impact
Any user or system that installs ts-bn-lint-helper version 3.1.19 and executes the from_str() function or runs npm test will have sensitive files and shell history from their working directory and home directory exfiltrated to an attacker-controlled server. This leads to credential leakage and exposure of potentially sensitive environment configuration and command history, which can be leveraged for further attacks or unauthorized access.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately remove ts-bn-lint-helper version 3.1.19 from their projects and avoid executing npm test or calling from_str() from this package. Audit dependencies for this package and replace it with trusted alternatives. Monitor for any suspicious network activity related to data exfiltration. Patch status is not yet confirmed — check the vendor advisory or trusted security sources for updates.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-6318
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-27pp-cq88-wg87"]
- Ecosystems
- ["npm"]
Threat ID: 6a96f316acd9273b49e49398
Added to database: 09/01/2026, 15:45:26 UTC
Last enriched: 09/08/2026, 14:37:57 UTC
Last updated: 10/03/2026, 18:25:31 UTC
Views: 27
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.