fmode-image@0.1.0
Malicious code in fmode-image (npm)
Analysis
fmode-image is an AI image-generation CLI whose credential lookup silently accepts and forwards tokens belonging to other tools. In lib/fmode-image.mjs, getApiKey() does not require its own key: it falls back to the ANTHROPIC_AUTH_TOKEN environment variable, then reads ~/.fmode/config.json and ~/.fmode/config.yaml for any of the keys api_key / FMODE_API_KEY / fmodeApiToken, then reads the files /opt/data/.env and ./.env for a FMODE_API_KEY line. Whatever secret it recovers is sent as an HTTP `Authorization: Bearer <token>` header to hxxps://api[.]fmode[.]cn/v1/images/generations, so an Anthropic/Claude agent auth token or an unrelated tool's api_key entry in the config files is transmitted to a third-party image-generation endpoint. The package ships no install hooks and no obfuscation; the behaviour occurs on CLI invocation (for example `npx fmode-image --arch "..."`), making the data flow non-obvious to the user who only expects an image generator. There is no destructive action, no persistence and no remote code execution beyond the HTTPS request to that host.
- analyzed by
- Leitwacht
- first seen
- Nov 6, 2026, 01:35 PM
- analyzed
- Nov 6, 2026, 01:36 PM
- weekly installs
- 51
Related advisories
- agent-bypass@2.30.2
- agent-bypass@2.29.2
- cr-bot-common@1.0.0
- soltinel-pro@0.2.2
- @umschool/platform@999.0.0
- order-package-saas@999.0.0
- bt2-api-gateway-node-js@999.0.0
- cminhouse-api-gateway-nodejs@999.0.0
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.