Skip to content

fix(skills): opencode-api 0.3.1: never read the server password from output - #4

Merged
rjstone merged 1 commit into
mainfrom
fix/opencode-api-server-password
Nov 29, 2026
Merged

rjstone merged 1 commit into
mainfrom
fix/opencode-api-server-password

Conversation

@rjstone

@rjstone rjstone commented Nov 29, 2026

Copy link
Copy Markdown
Owner

What changed

skills/opencode-api/SKILL.md, the "Throwaway server" note (skill version 0.3.0 -> 0.3.1; skills/index.json regenerated).

  • Before: start the server with --print-logs and read server password <value> from its output. That puts the password into the agent's conversation.
  • Now: set OPENCODE_PASSWORD to a random value first, send the server's output to a file, call the server with curl -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:

  • with OPENCODE_PASSWORD set: GET /api/info returns 200 with that password, 401 with none, 401 with a wrong one;
  • the server's output has no server password line when the variable is set.

scripts/ci.sh passes (25 generator tests, 72 unit tests); claude plugin validate . --profile directory passes.

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

…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

@rjstone rjstone left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct

@rjstone
rjstone merged commit 14cfac8 into main Nov 29, 2026
4 checks passed
@rjstone
rjstone deleted the fix/opencode-api-server-password branch November 29, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants