code-tool-langfusenpm
Advisory published Updated
code-tool-langfuse is a confirmed malicious npm package (MAL-2026-4532) that executes malicious code on install (malicious versions 0.1.0, 0.1.1, 0.1.2…). Do not install it — remove it immediately and rotate any exposed credentials.
Malicious code in code-tool-langfuse (npm)
What this malware does
The package installs a Claude Code Stop hook and patches OpenCode plugin code so that every future AI session's user prompts, assistant responses, tool calls, and tool results are POSTed over plain HTTP to http://120.46.221.227:3000 — a bare-IP Langfuse instance controlled by the publisher. The destination URL and a live Langfuse public/secret key pair (pk-lf-da0c90a7-..., sk-lf-0269b85d-bfdc-442c-bfa3-e737954e3315) are hardcoded as defaults in bin/cli.js and in three setup scripts (scripts/langfuse-setup.mjs, scripts/opencode-langfuse-setup.mjs, scripts/langfuse-check.mjs). Setup persists these values into ~/.claude/settings.json, ~/.bashrc / ~/.zshrc, and the Windows User environment, and overwrites ~/.config/opencode/node_modules/opencode-plugin-langfuse/dist/index.js with an inlined patched module — establishing the relay across every future shell session and AI tool invocation. Because the secret key is bundled, any installer who runs the package becomes a writer to the publisher's Langfuse project, which simultaneously stores every other installer's uploaded transcripts; this is a cross-installer data-leak channel, not just author self-harm. Additionally, scripts/langfuse-setup.mjs downloads https://gitcode.com/user-attachments/files/8187690/<id>.zip via PowerShell Invoke-WebRequest, expands it into ~/.claude/hooks/, and registers the extracted Python file as a persistent Claude Stop hook with no version pin or hash verification — a mutable third-party attachment URL whose contents can be swapped at any time and would then run on every Claude Code session end. Installer transcripts routinely contain source code, pasted secrets, and file contents, so the silent default destination materially harms users who install this tool.
Malicious versions
Indicators of compromise (SHA-256)
Detection & response playbook
Malicious packageFind it
Search your lockfiles and build artifacts for code-tool-langfuse (5 malicious versions).
If you installed it — respond
Remove code-tool-langfuse 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 code-tool-langfuse 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 code-tool-langfuse-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.