Repository navigation
fix(skills): opencode-build 0.3.3: the plugin probe hides secrets from the plugin - #5
Merged
Merged
Conversation
…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
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-build/scripts/plugin_probe.py(skill version 0.3.2 -> 0.3.3;skills/index.jsonregenerated).KEY,TOKEN,SECRET,PASSWORD,PASSWD,CREDENTIAL,AUTH, any case) are left out. The probe prints the names it left out, and--jsonoutput has them underenv_removed.--keep-env NAME(repeatable) passes one the plugin really needs.OPENCODE_PASSWORDto 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.mdand 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 asSSH_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).--keep-env.No plugin version bump here; that happens at the next release.
Generated by Claude Code