You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Security Issue - Lifecycle Script Execution via .opencode/package.json #7173
OpenCode automatically runs bun install in any .opencode directory found in the current project at startup. This executes preinstall/postinstall scripts defined in .opencode/package.json without user confirmation. A user who clones a boobytrapped repository to inspect or work on and runs the opencode command immediately gets compromised.
The root cause is in packages/opencode/src/config/config.ts - the installDependencies() function runs bun install in each .opencode directory:
Activity
github-actions commentedon Jan 7, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if this specific lifecycle script execution path needs separate handling from the plugin loading mechanism.
CyberShadow commentedon Feb 13, 2026
@xpcmdshell If you haven't done so already, would you mind filing this as an advisory so that it gets due process? https://github.com/anomalyco/opencode/security/advisories/new
xpcmdshell commentedon Feb 16, 2026
Submitted each advisory, will await review
github-actions commentedon Apr 18, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
xpcmdshell commentedon Apr 18, 2026
Looks like this might have been fixed as a side effect of a different refactor?
629e866
Both filed advisories were closed by maintainers though