Skip to content

fix(nexus): audit security fixes (repo API trust, read-only plan mode, deny/jail gaps) - #34

Merged
Darknode-Official merged 1 commit into
mainfrom
fix/audit-security
Nov 22, 2026
Merged

Darknode-Official merged 1 commit into
mainfrom
fix/audit-security

Conversation

@Darknode-Official

@Darknode-Official Darknode-Official commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

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.json could set apiBase/apiKey, and Nexus applied them before any trust check. Now they are held back until /trust (or DARKNODE_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:

  • claude: --permission-mode plan; the ask bridge is still allowed
  • codex: --sandbox read-only
  • gemini: no --yolo
  • opencode: --agent plan
  • aider: --dry-run --no-suggest-shell-commands

In plan mode the MCP bridge also drops user servers and hides and refuses the sessions tool.

3. Medium: gaps in deny rules and the path jail

  • A 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.
  • The path jail now canonicalises file, src, source and destination, not just path, to, dest and from.

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 plan agent's permissions.

…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.
@Darknode-Official
Darknode-Official merged commit 20af274 into main Nov 22, 2026
6 checks passed
@Darknode-Official
Darknode-Official deleted the fix/audit-security branch November 22, 2026 23:34
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.

1 participant