Skip to content

fix(skills): opencode-build 0.3.3: the plugin probe hides secrets from the plugin - #5

Merged
rjstone merged 1 commit into
mainfrom
fix/opencode-build-probe-env
Nov 29, 2026
Merged

rjstone merged 1 commit into
mainfrom
fix/opencode-build-probe-env

Conversation

@rjstone

@rjstone rjstone commented Nov 29, 2026

Copy link
Copy Markdown
Owner

What changed

skills/opencode-build/scripts/plugin_probe.py (skill version 0.3.2 -> 0.3.3; skills/index.json regenerated).

  • Before: the probe started its throwaway opencode server with a full copy of the caller's environment. The plugin under test runs inside that server, so it could read every API key and token in the environment.
  • Now: variables whose names look like secrets (KEY, TOKEN, SECRET, PASSWORD, PASSWD, CREDENTIAL, AUTH, any case) are left out. The probe prints the names it left out, and --json output has them under env_removed. --keep-env NAME (repeatable) passes one the plugin really needs.
  • Server password: the probe now sets OPENCODE_PASSWORD to a random value, so the server prints none in its log. It used to read the generated password from the log. If an opencode ignores the variable and prints its own, that one is still picked up.

SKILL.md and the script's docstring say so.

Why

A SkillSpector scan flagged dict(os.environ) in the probe (E2). The finding is fair: a probe exists to load a plugin you may not trust yet.

Behaviour change to know about

A plugin that needs an environment variable with a secret-looking name will no longer see it under the probe unless it is passed with --keep-env. The filter is by name, so it also drops harmless variables such as SSH_AUTH_SOCK, and it cannot catch a secret stored under an innocent name.

Tested

  • scripts/ci.sh: 25 generator tests and 74 unit tests pass (2 new, for the environment filter).
  • A real run on opencode 2.4.2 against an empty plugin folder: the server started, the API answered with the chosen password, and 20 secret-looking variables were left out and listed by name.
  • Not tested: a real plugin that reads an environment variable, with and without --keep-env.

No plugin version bump here; that happens at the next release.


Generated by Claude Code

…m the plugin

plugin_probe.py started its throwaway server with a full copy of the
caller's environment, so the plugin under test could read every API key
and token in it.

- Variables whose names look like secrets (KEY, TOKEN, SECRET, PASSWORD,
  CREDENTIAL, AUTH) are left out of the server's environment. The probe
  prints their names; --keep-env NAME passes one the plugin needs.
- The server gets a random password through OPENCODE_PASSWORD, so none
  is printed in its log (the probe used to read it from there). A
  password in the log is still used, for an opencode that ignores the
  variable.

Found by a SkillSpector scan (E2 on plugin_probe.py).

Tested: two new unit tests (74 pass), and a real run on opencode 2.4.2:
the server started, the API answered with the chosen password, and 20
secret-looking variables were left out.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QT6szv5y1hHiZr5DD8HJkv
@rjstone
rjstone merged commit f27fa6d into main Nov 29, 2026
4 checks passed
@rjstone
rjstone deleted the fix/opencode-build-probe-env branch November 29, 2026 04:22
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