tokenization-util
Affected
- introduced
0(semver)
Fixed versions
None listed
Fix
No fixed version is listed.
Advisory
Also known as: GHSA-wp9r-fqrq-cg5h
Malicious package Its source marks this package as malicious: it is not a vulnerability in a legitimate one.
Malicious code in tokenization-util (npm)
---
_-= Per source details. Do not edit below this line.=-_
Source: amazon-inspector (81f8a194aa79844110dede95f5f8c798d05c04c08f1a4f5d8822124b17c65fa6)
The package advertises plain math/formatter helpers but index.js contains a heavily obfuscated payload concealed inside the calculateTokenPrice function. The payload is hidden behind ~1500 leading tab characters of visual padding, then uses two seeded Fisher-Yates string-shuffler decoders and String.fromCharCode splicing to reconstruct the identifiers 'constructor', 'require', and 'module' at runtime. The code resolves Function via yLb[kqz] (a string-shuffled property lookup for 'constructor'), uses that Function constructor to build a decoder from one shuffled blob, decodes a second scrambled blob into JS source, and invokes that source via Function(...)(3004). It also assigns the CommonJS require and module bindings to globalThis (global[require]=require; global[module]=module), giving the decoded code access to any Node built-in (network, fs, child_process) regardless of how the package is imported. None of this behavior is documented in the README or exposed through the advertised API. The combination of multi-layer obfuscation, visual concealment via tab padding, dynamic eval of decoded literals, and forced global exposure of require/module is the canonical shape of a hidden remote-code-execution backdoor in an npm utility package — the decoded payload runs whenever calculateTokenPrice is called by a consumer.
Source: ghsa-malware (6889e1ba434ec22ee416286fff9c2917794ee60aa78361043e1742767ca877f2)
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.
0 (semver)None 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