Repository navigation
fix(nexus): audit security fixes (repo API trust, read-only plan mode, deny/jail gaps) - #34
Merged
Merged
Conversation
…ly, close deny/jail gaps - An untrusted repo's .nexus/config.json apiBase/apiKey is no longer applied until /trust (or DARKNODE_TRUST_REPO=1); those keys are folded into the trust digest so changing them re-prompts. - Plan mode now runs every engine in its own read-only mode: claude --permission-mode plan (ask bridge still allowed), codex --sandbox read-only, gemini without --yolo, opencode --agent plan, aider --dry-run. The MCP bridge drops user servers and hides the sessions tool in plan mode. - A run_command deny rule now also screens verify/bisect/sessions and the other shell-running tools by the command they will run. - The path jail canonicalises file/src/source/destination as well.
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.
Fixes the three Nexus issues from the 2026-11-20 bug audit.
1. Critical: an untrusted repo could redirect the API and steal the key
A cloned repo's
.nexus/config.jsoncould setapiBase/apiKey, and Nexus applied them before any trust check. Now they are held back until/trust(orDARKNODE_TRUST_REPO=1), and those two keys are part of the trust digest, so changing them asks for trust again. Existing trust entries stay valid when a repo has neither key.2. High: plan mode was not read-only for external engines
Each engine now runs in its own read-only mode in plan mode:
--permission-mode plan; the ask bridge is still allowed--sandbox read-only--yolo--agent plan--dry-run --no-suggest-shell-commandsIn plan mode the MCP bridge also drops user servers and hides and refuses the
sessionstool.3. Medium: gaps in deny rules and the path jail
run_command/Bash(...)deny rule now also screens the other tools that run shell commands (verify,bisect,sessions, etc.), judged on the command they will actually run.file,src,sourceanddestination, not justpath,to,destandfrom.Tests: new checks in
test/run.js, including a real spawn of the MCP shim in read-only mode.HOME=/tmp/nxhome-full npm test: all 45 suites pass, exit 0.Limitation: opencode's own user-configured MCP servers depend on its
planagent's permissions.