Summary
Togoder Security scanned the npm package @npmcli/fs@5.0.0 on Oct 6, 2026. An AI review of 9 source files produced 1 high, 2 medium severity findings. The overall verdict is medium: the findings flag risky but common patterns (dynamic code, unsafe defaults, broad file or network access) rather than confirmed malware.
Findings 3
File system manipulation outside package scope
NPS-6F09D70122D1
The moveFile function recursively moves arbitrary source and destination paths, including symlinks, and ultimately deletes the source with fs.rm(source, { recursive: true, force: true }). This can delete or overwrite files outside the package scope if called with arbitrary paths.
Default overwrite enabled
NPS-7205034EE584
options.overwrite defaults to true. When overwrite is enabled, destination files are silently replaced, which can lead to data loss.
Symlink following/manipulation
NPS-6D6EB74E30B6
The code reads symlink targets with fs.readlink and creates symlinks pointing to computed targets. This can be abused to follow symlinks and move/copy files outside intended directories.
Files reviewed
| File | Verdict | What the reviewer saw |
|---|---|---|
| lib/move-file.js | medium | The code is not overtly malicious, but it performs arbitrary recursive file moves, symlink manipulation, and recursive deletion with overwrite enabled by default, which could be dangerous if exposed to untrusted input. |
| lib/common/get-options.js | safe | Cleared by Jev triage; no further analysis needed |
| lib/common/node.js | safe | Cleared by Jev triage; no further analysis needed |
| lib/cp/errors.js | safe | Cleared by Jev triage; no further analysis needed |
| lib/cp/index.js | safe | This is a standard Node.js file system copy utility that delegates to native fs.cp or a local polyfill, with no malicious patterns detected. |
| lib/cp/polyfill.js | safe | No malicious patterns detected; this is a local filesystem copy polyfill with no network, process execution, or obfuscated code. |
| lib/index.js | safe | Cleared by Jev triage; no further analysis needed |
| lib/readdir-scoped.js | safe | No malicious patterns detected; the code only reads directory contents recursively for scoped packages. |
| lib/with-temp-dir.js | safe | No malicious patterns detected; the code creates and cleans up a temporary directory using standard Node.js APIs. |
Frequently asked questions
Is @npmcli/fs safe to use?
No confirmed malware was found in @npmcli/fs@5.0.0, but the review flagged 1 high, 2 medium severity findings for risky patterns worth checking before you rely on it.
Does @npmcli/fs contain malware?
No malware was identified in @npmcli/fs@5.0.0 when Togoder Security scanned it on Oct 6, 2026. A new version can still introduce malicious code, so scan the exact versions in your lockfile.
How was @npmcli/fs checked?
Togoder Security downloaded the published npm package and had an AI model read its 9 source files, looking for install scripts, credential access, network exfiltration, obfuscation, backdoors and crypto-wallet theft. The results are cached by file hash and shown here.
How do I scan @npmcli/fs together with the rest of my dependencies?
Upload your lockfile at https://security.togoder.click/scan or call the API documented at https://security.togoder.click/api-docs. Files that have already been scanned, like the ones in @npmcli/fs@5.0.0, cost nothing.