A remote access implant was identified within the npm package 'mathmain', which is a duplicate of the 'mathjs' library. The malicious component is encrypted and remains inactive until a specific equation is processed by the library. This equation functions as a decryption key.
Upon solving the correct equation, the package decrypts and executes a payload. This payload is designed to receive commands from an attacker and execute them on the compromised host. It utilizes a public chat service and a blockchain network to establish its command and control channel.
The loader was found during a SafeDep analysis of 'mathmain' on September 17, 2026. An added call within the 'lusolve()' function, specifically 'removeSolveValidation()', led to the discovery. This function, disguised as 'isGraph()', converts input data into a JSON string used as a password. It then decrypts a filename and loads the returned path.
The decryption process, located in 'lib/cjs/utils/event.js', uses 'scrypt' to generate a 256-bit key from the password, followed by AES-GCM for data decryption. The encrypted data includes a salt, initialization vector, and authentication tag, stored as base64 text. The password for calls through the solver is 'JSON.stringify(L._data)', requiring specific matrix data to trigger decryption.
This discovery highlights the risks associated with using copied or similarly named packages in software development. The sophisticated method of hiding and triggering the malicious payload underscores the need for thorough security analysis of third-party dependencies, even those appearing to be benign copies of popular libraries.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
A remote access implant was discovered hidden within the npm package 'mathmain', a copy of the 'mathjs' library. The malicious code remains dormant until a specific mathematical equation is solved, which acts as a key to decrypt and execute a payload that takes commands via a public chat service and blockchain network.