module-relpathnpm
Advisory published Updated
module-relpath is a confirmed malicious npm package (MAL-2026-14561) that executes malicious code on install (malicious versions 1.0.1, 1.0.2, 1.0.3). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in module-relpath (npm)
What this malware does
The package presents itself as relative-import-path (README title, homepage and repository URL point at github.com/marko-js/relative-import-path, and the.d.ts documents only relativeImportPath), but the CJS bundle at dist/index.js does not export the documented API. Instead it exports a single undocumented function modshit(moduleName, size) that reads public/logo.png from the current working directory, slices the trailing size bytes off the file, resolves the path ../${moduleName}/public/logo.png relative to its own directory, creates parent directories as needed, and writes those trailing bytes to that location. The effect is a steganographic second-stage helper: bytes appended to the tail of a PNG are extracted and planted into an arbitrary sibling package's directory on the installer's disk under the caller's chosen name. The exported symbol does not match the documented API, is named to obscure its purpose, and provides a primitive whose only use is smuggling payload bytes hidden inside an image into other node_modules entries.
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.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
Malicious packageFind it
Search your lockfiles and build artifacts for module-relpath (3 malicious versions).
If you installed it — respond
Remove module-relpath from your project and lockfile, then assume any secrets accessible to the build or runtime were exposed: rotate API keys, tokens, and credentials, and audit for unexpected outbound activity or persistence.
Did it already run?
If module-relpath was installed, its post-install payload may already have run. Removing the package does not undo that — check outbound connections and credential use from the install window onward.
Frequently asked questions
Campaign
References
Credits
- Amazon Inspector · finder
Detect & block this
O3 blocks module-relpath-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the malicious outbound activity and severs the channel.