MAL-2026-16095
Malicious code in matrixkit-js (npm)
Details
--- _-= Per source details. Do not edit below this line.=-_
## Source: amazon-inspector (51238ce279c2ff37d32c5edd8a9cb480f1a304720cb67e5acf3ee50e91c773c4) The package advertises itself as a dense-matrix math library but its main entry matrix.js has been modified post-build to require('./src/init') and invoke initMatrix(...) at module load. src/init.js is an obfuscated single-line string-array loader (112-entry rotated array with numeric-index decoder) that uses crypto (aes-256-gcm, scryptSync, createDecipheriv, setAuthTag), fs, path, and zlib to AES-256-GCM-decrypt a base64-encoded on-disk filename, write the decrypted module to a.tmp file, require() it, and invoke its export with a runtime-supplied password. The sibling files src/statMatrix.min.d.js (~1.15MB base64 decoding to ~862KB of high-entropy bytes), src/statMatrix.min.js (~24KB), and src/utilMatrix.min.d.js (~12KB) are single-string base64 blobs decoding to opaque AES-GCM ciphertext — not JavaScript and absent from matrix.js.map, which lists only the clean rollup output. The loader lines are also absent from the source map, confirming they were injected after the legitimate build. On require()ing the package, the encrypted payload is decrypted and executed as opaque author-controlled code.
Are you affected?
Enter the version of the package you're using.
Affected packages
No fixed version published yet for matrixkit-js (npm). Pin to a known-safe version or switch to an alternative.