Malicious code in opencode-optimised-toolings (npm)
The npm package opencode-optimised-toolings versions 3.4.0, 4.0.0, and 4.0.1 contains malicious code that performs a self-patching operation without user consent. It downloads a source tarball from a non-official GitHub repository, builds a replacement binary, and replaces the legitimate opencode executable on the user's system. This replacement binary runs under the trusted CLI name, allowing persistent code execution with the user's privileges. The package also modifies user configuration files to ensure the malicious behavior persists across future launches.
AI Analysis
Technical Summary
The opencode-optimised-toolings npm package (versions 3.4.0, 4.0.0, and 4.0.1) includes a malicious self-patching mechanism triggered on plugin load. It downloads an OpenCode source tarball from a non-publisher GitHub repository (github.com/anomalyco/opencode), builds a binary using 'bun install' and a build process, then replaces the user's on-PATH opencode executable with this malicious binary. This replacement executes with the user's privileges under the trusted CLI name, providing persistent unauthorized code execution. Persistence is reinforced by modifying configuration files (~/.config/opencode/opencode.jsonc and tui.json) and injecting markers into documentation files, ensuring the self-patching continues on subsequent executions. The upstream source is mutable and lacks full verification, increasing risk.
Potential Impact
This malicious package enables persistent code execution with the user's privileges by replacing a trusted CLI binary with a malicious one. This can lead to unauthorized actions on the host system under the user's identity. The persistence mechanisms ensure the malicious code remains active across multiple executions, potentially compromising the integrity and security of the affected environment.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately uninstall opencode-optimised-toolings versions 3.4.0, 4.0.0, and 4.0.1 and avoid using this package until a trusted version is released. Verify the source and integrity of packages before installation, especially those that perform self-modifying actions. Monitor for unexpected modifications to the opencode executable and related configuration files. Patch status is not yet confirmed — check the vendor advisory or official sources for current remediation guidance.
Malicious code in opencode-optimised-toolings (npm)
Description
The npm package opencode-optimised-toolings versions 3.4.0, 4.0.0, and 4.0.1 contains malicious code that performs a self-patching operation without user consent. It downloads a source tarball from a non-official GitHub repository, builds a replacement binary, and replaces the legitimate opencode executable on the user's system. This replacement binary runs under the trusted CLI name, allowing persistent code execution with the user's privileges. The package also modifies user configuration files to ensure the malicious behavior persists across future launches.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The opencode-optimised-toolings npm package (versions 3.4.0, 4.0.0, and 4.0.1) includes a malicious self-patching mechanism triggered on plugin load. It downloads an OpenCode source tarball from a non-publisher GitHub repository (github.com/anomalyco/opencode), builds a binary using 'bun install' and a build process, then replaces the user's on-PATH opencode executable with this malicious binary. This replacement executes with the user's privileges under the trusted CLI name, providing persistent unauthorized code execution. Persistence is reinforced by modifying configuration files (~/.config/opencode/opencode.jsonc and tui.json) and injecting markers into documentation files, ensuring the self-patching continues on subsequent executions. The upstream source is mutable and lacks full verification, increasing risk.
Potential Impact
This malicious package enables persistent code execution with the user's privileges by replacing a trusted CLI binary with a malicious one. This can lead to unauthorized actions on the host system under the user's identity. The persistence mechanisms ensure the malicious code remains active across multiple executions, potentially compromising the integrity and security of the affected environment.
Mitigation Recommendations
No official patch or remediation is currently documented. Users should immediately uninstall opencode-optimised-toolings versions 3.4.0, 4.0.0, and 4.0.1 and avoid using this package until a trusted version is released. Verify the source and integrity of packages before installation, especially those that perform self-modifying actions. Monitor for unexpected modifications to the opencode executable and related configuration files. Patch status is not yet confirmed — check the vendor advisory or official sources for current remediation guidance.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-13452
- Osv Schema Version
- 1.7.4
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a7573b5bf8831d539d93bb2
Added to database: 08/07/2026, 05:57:09 UTC
Last enriched: 08/07/2026, 07:32:39 UTC
Last updated: 08/07/2026, 07:32:39 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.