Repository navigation
fix(skills): opencode-api 0.3.1: never read the server password from output - #4
Merged
Merged
Conversation
…output The throwaway-server note told the agent to start the server with --print-logs and read "server password <value>" from its output, which puts the password into the conversation. It now has the agent set OPENCODE_PASSWORD to a random value before starting the server, send the server's output to a file, and never read a password line. Checked on opencode 2.4.2: with the variable set, the server accepts that password (200), refuses none or a wrong one (401), and prints no password line. Found through the Snyk audit shown on skills.sh (W007 on this skill). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QT6szv5y1hHiZr5DD8HJkv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
skills/opencode-api/SKILL.md, the "Throwaway server" note (skill version 0.3.0 -> 0.3.1;skills/index.jsonregenerated).--print-logsand readserver password <value>from its output. That puts the password into the agent's conversation.OPENCODE_PASSWORDto a random value first, send the server's output to a file, call the server withcurl -u "opencode:$OPENCODE_PASSWORD", and never read a password line.Why
The Snyk audit shown on skills.sh rates this skill HIGH for W007 (insecure credential handling) and names exactly this branch. The finding is correct.
Tested
On opencode 2.4.2, with a throwaway server and temp
XDG_*folders:OPENCODE_PASSWORDset:GET /api/inforeturns 200 with that password, 401 with none, 401 with a wrong one;server passwordline when the variable is set.scripts/ci.shpasses (25 generator tests, 72 unit tests);claude plugin validate . --profile directorypasses.Not changed
Snyk's other finding on this skill (W013, "modifies system services", low risk 0.10) describes what the skill is for: calling an opencode server's API. Nothing to fix.
No plugin version bump here; that happens at the next release.
Generated by Claude Code