Malicious code in @tinyfox/shapecheck (npm)
MAL-2026-6312 · GHSA-9q9p-jf58-9fxg
Published · Modified
Dependency scanning
Check whether @tinyfox/shapecheck is in your codebase
Corgea flags malicious and compromised dependencies with reachability analysis, so you fix the packages that actually run in your application instead of working through the whole lockfile.
Description
@tinyfox/shapecheck (malicious version 0.8.7, published by tinyfox-yjwiqz@wshu.net) is a trojanized npm package belonging to the wshu.net credential-stealer campaign. The campaign published trojanized look-alike utility packages across 12+ scopes whose publisher accounts all follow the pattern
__
Source: amazon-inspector (ccad6ae47c18b5b41d16625a00ce1b493fc44d7e22658d549ff709d6df297b70)
Package @tinyfox/shapecheck re-publishes the source of the legitimate rulr validation library (repository field still points at git+https://github.com/ryasmi/rulr.git) under a different name, and adds an obfuscated dist/bootstrap.cjs (~282 KB, obfuscator.io-style string-array + RC4-style decoder) that the library's main entry dist/rulr.cjs requires on every load. The exported object() API immediately calls __tb.runPrepare(), so simply require('@tinyfox/shapecheck') and using its documented validation API fires the malicious bootstrap. The bootstrap dynamically imports https, child_process, crypto, fs, os, path, net; HTTPS-downloads files together with <file>.meta hash metadata; AES-256-GCM-decrypts in-package ciphertext with hardcoded base64 key/iv/aad; stages the result in os.tmpdir()/installer-<euid>; and executes the decrypted bytes via process.execPath or sh -c, with redirect handling, 25-minute timeout, retry/backoff, and PID-collision detection. It also implements an argv-hijacking re-spawn: it reads process.argv.slice(2), sets a sentinel env var to prevent recursion, and child_process.spawn(process.execPath, argv, { env, stdio: 'inherit', detached: true }).unref()s the operator's original Node invocation under bootstrap control — wrapping any script the developer runs as a child of the malware. The bootstrap is also directly executable: if (require.main === module) onInstall() triggers the same payload when a developer runs node node_modules/@tinyfox/shapecheck/dist/bootstrap.cjs. There are no preinstall/install/postinstall/prepare lifecycle hooks, so harm fires on require/import of the package or on direct invocation, not on npm install itself.
Source: ghsa-malware (aaa543cc50875b28ce62331f894b07b97ef908e1699551e7e2cb2920ceae3200)
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.
References
- PACKAGE https://www.npmjs.com/package/@tinyfox/shapecheck/v/0.8.5
- PACKAGE https://www.npmjs.com/package/@tinyfox/shapecheck/v/0.8.6
- PACKAGE https://www.npmjs.com/package/@tinyfox/shapecheck/v/0.8.7
- PACKAGE https://www.npmjs.com/package/@tinyfox/shapecheck/v/0.8.8
- PACKAGE https://www.npmjs.com/package/@tinyfox/shapecheck/v/0.7.4
- REPORT https://safedep.io/wshu-net-npm-credential-stealer-campaign/
- PACKAGE https://www.npmjs.com/package/@tinyfox/shapecheck
- ADVISORY https://github.com/advisories/GHSA-9q9p-jf58-9fxg
Ready to move
Start Securing
Free, no credit card | First findings in minutes