Togoder security

npm package security report

@npmcli/fs npm package: is it safe?

Risky patterns found that deserve a look.

Needs review Version 5.0.0 Files reviewed 9 Size 20.4 KB Scanned

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.

0
critical
1
high
2
medium
0
low

Findings 3

high

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.

lib/move-file.js:10
medium

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.

lib/move-file.js:22
medium

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.

lib/move-file.js:54

Files reviewed

FileVerdictWhat 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.

Scanned versions of @npmcli/fs

VersionVerdictFilesScanned
5.0.0 Needs review 9 Oct 6, 2026

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.

Related security reports