GHSA-qjw2-5743-xhp4
Malicious code in txnforge (npm)
Auswirkung
The package advertises itself as a synthetic transaction data generator, but its sole documented function getTransactions() loads base64-encoded 'mark' fields from database.js, Caesar-decodes them using a per-record shift, and executes the resulting string via the Function constructor with Buffer, require, and process bound as arguments. The dangerous identifiers (Function, Buffer, require, process, setTimeout, clearTimeout) are reassembled at runtime from character fragments, and the Function constructor is resolved indirectly via globalThis.constructor.constructor, concealing the dynamic-execution sink from static analysis. The payload runs with full Node.js capabilities (file system, child process, network) in the context of any process that requires the package and invokes its advertised API. The manifest also declares python-shell and axios as dependencies that are never referenced by the shipped source, consistent with capability staged for the hidden payload rather than for the stated purpose of the library. 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.
Betroffene Pakete
| Ökosystem | Paket | Betroffen | Behoben in |
|---|---|---|---|
| npm | txnforge | >= 0 | nicht erfasst |