From 944d41803717ececc230d496ba4501c29eed30b7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Nov 2026 01:42:26 +0000 Subject: [PATCH] fix(skills): opencode-api 0.3.1: never read the server password from output The throwaway-server note told the agent to start the server with --print-logs and read "server password " 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 Claude-Session: https://claude.ai/code/session_01QT6szv5y1hHiZr5DD8HJkv --- skills/index.json | 2 +- skills/opencode-api/SKILL.md | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/skills/index.json b/skills/index.json index 64531a2..d4e5719 100644 --- a/skills/index.json +++ b/skills/index.json @@ -2,7 +2,7 @@ "skills": [ { "name": "opencode-api", - "version": "0.3.0", + "version": "0.3.1", "files": [ "ERRATA.md", "SKILL.md", diff --git a/skills/opencode-api/SKILL.md b/skills/opencode-api/SKILL.md index f4bebd4..cd1bfc9 100644 --- a/skills/opencode-api/SKILL.md +++ b/skills/opencode-api/SKILL.md @@ -6,7 +6,7 @@ license: MIT metadata: author: Robert Stone source: https://github.com/rjstone/opencode-dev-plugin - version: "0.3.0" + version: "0.3.1" --- # opencode server API (v2) @@ -70,9 +70,15 @@ disagree, `ERRATA.md` wins. argument: body `{"input": }` → `{"output": }`. `rpcID` is the id in the plugin's `Rpc.define`. A bare argument as the body → `rpc.invalid_input` "Expected object". -- **Throwaway server** (tests, sandboxes): `opencode serve --hostname - 127.0.0.1 --port --print-logs` prints `server password ` at - startup; point `XDG_CONFIG_HOME`, `XDG_DATA_HOME`, `XDG_CACHE_HOME` and +- **Throwaway server** (tests, sandboxes): choose the password yourself, so + you never have to read one: `export OPENCODE_PASSWORD="$(openssl rand -hex 24)"`, + then `opencode serve --hostname 127.0.0.1 --port > serve.log 2>&1 &` + and call it with `curl -u "opencode:$OPENCODE_PASSWORD" ...`. With the + variable set the server prints no password (checked 2026-11-28 against + opencode 2.4.2). Without it, the server makes one up and prints + `server password ` at startup: don't start it that way, and never + read that line into the conversation. Send the server's output to a file + either way. Point `XDG_CONFIG_HOME`, `XDG_DATA_HOME`, `XDG_CACHE_HOME` and `XDG_STATE_HOME` at a temp folder to keep it off your real setup. A location's plugins load in the background after its first request, so plugin-provided agents, skills, references and MCP servers appear a few