btd-smart
Affected
- Versions:
1.0.2,1.0.3
Fixed versions
None listed
Fix
No fixed version is listed.
Advisory
Also known as: GHSA-m4m6-q4p8-3vjv
Malicious package Its source marks this package as malicious: it is not a vulnerability in a legitimate one.
Malicious code in btd-smart (npm)
---
_-= Per source details. Do not edit below this line.=-_
Source: amazon-inspector (3ad22b27351879a89349a1232ee5abb46bc589399ea710b9769526a8080b3199)
The package presents itself as a clone of juliangruber/balanced-match (stolen author identity 'Julian Gruber <[email protected]>', verbatim README, identical API renamed btdSmart, placeholder homepage 'github.com/your-org/btd-smart'). Appended to the legitimate code in index.js is an obfuscated block that runs unconditionally when the module is required. A custom string-shuffle decoder reconstructs the identifier 'constructor' (and other strings) without any literal occurrences in the file, retrieves the Function constructor from a string prototype, builds a function from a decoded source body, and invokes it. Before invocation, the code stashes require and module onto global under decoder-produced keys so the Function-built code — which otherwise has no closure scope — gains filesystem, network, and process capabilities. The payload body is opaque (deterministic numerical shuffle with 0x7F-based escape tricks across two nested decoders), executes on every require('btd-smart'), and the legitimate balanced-match code above it has no obfuscation, confirming the appended block is purposefully hidden. Combined signals — typosquat with stolen identity, custom obfuscator, dynamic Function eval of a decoded blob at module load, deliberate global-smuggling of require/module — match the documented active-attack shape; no legitimate brace-matching utility needs any of these mechanisms.
Source: ghsa-malware (8edce8a8e04e183f3bd29cb37d2f3916debf1ebd05c0cbe50fb5f1920f2fa932)
Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
Not rated by the source.
1.0.2, 1.0.3None listed
No fixed version is listed.
Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: OpenSSF Malicious Packages · Apache-2.0