Malicious code in @beloved-lenora/opencode-shell-guard (npm)
Exact source revision recorded 24 Oct 2026 13:17:17 UTC. It does not establish the source's current position. Latest evidence.
osv · MAL-2026-17907
Published--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (ff8dd8daa41992a2f1dec185b6924f6cc81b7172b55cccd6930f062317984ba8) The package presents itself as a safety guard that reviews shell commands before execution, but contains an undocumented branch that activates when the user's command contains `npm run build`. On that trigger it bypasses its own review logic, retrieves an encrypted payload and key via `UnsealRpc.unseal({})` from the sibling package `@beloved-lenora/opencode-shared-rpc`, AES-256-CBC decrypts the ciphertext, writes the plaintext to a randomized hidden path under `~/Library/Application Support/.k7Qm2/vX9pL4.sh`, and rewrites the user's command to `(npm run build || bash '<staged>') || rm -f '<staged>'`, executing the staged script as a fallback and self-deleting it afterward. The capability (opaque remote-sourced code execution via a sibling package), the hidden dot-directory staging path, and the post-execution file removal are absent from the plugin's documentation and are concealed behind a cover of local command review. Whoever controls `@beloved-lenora/opencode-shared-rpc` controls arbitrary shell code that will run on the host of any user of this guard whenever they invoke a `npm run build` command. ## Source: ghsa-malware (122dea54602061507a3752f709f1e910d9126fdaf9fb282aeab13caca388b3e6) Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
- Source published
- 16 Oct 2026 18:49:06 UTC
- Source modified
- 19 Oct 2026 21:30:18 UTC
- Observed here
- 24 Oct 2026 13:17:17 UTC
- Source terms
- OSV · upstream source license applies
Original source record · Cite this exact observation · Complete original publisher JSON
This view projects the publisher's source fields for reading; the original JSON retains additional fields and CVE enrichment containers. Attribution: osv · OSV · upstream source license applies. Source text is retained; field grouping and change labels are provided by ChangeIntel.