Skip to main content
Menu
Advisories

Startup update check executes code from node_modules in the current working directory

GHSA-V68M-49GM-5HGWPublished Updated GitHub

Description

Impact

On startup, most ruflo / claude-flow CLI commands run a background update check. To find the installed version of each @claude-flow/* package, getInstalledVersion() in v3/@claude-flow/cli/src/update/checker.ts resolved <pkg>/package.json with require.resolve(..., { paths: [process.cwd()] }) and then loaded the result with require().

Resolution therefore started in the directory the user ran the command from. A repository that contains a crafted node_modules/@claude-flow/<pkg>/package.json with an exports map pointing ./package.json at a JavaScript file gets that file executed, with the user's privileges, as soon as anyone runs e.g. npx ruflo status inside it. No prompt or flag is required.

The check is skipped in CI, with --no-update, for doctor --json and observe-only commands, and at most once per check interval.

Patches

Fixed in 3.80.1 of ruflo, claude-flow and @claude-flow/cli (ruvnet/ruflo#5072). The version is now resolved only from the CLI's own install location and package.json is read with JSON.parse(fs.readFileSync()), so it is never executed. A regression test plants the malicious packages in the working directory.

Workarounds

Upgrade. Otherwise pass --no-update (or set CI=1) when running the CLI inside an untrusted checkout.

Credit

Found while fixing the same class of issue in ruvector (GHSA-8pv4-hqq5-m2wv).

Affected versions

References

GitHub · ruvnet/ruflo