[PR #4433] fix: permission checks for external_directory and doom_loop #10969

Closed
opened 2026-02-16 18:15:44 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/4433

State: closed
Merged: Yes


Summary

Fixes permission checks that were not properly enforcing deny settings, allowing operations to proceed when they should be blocked.

Root Cause

Permission checks across the codebase were using an insecure pattern:

  • Only checking for "ask" or specific values
  • Ignoring "deny" settings
  • Allowing operations when permission was undefined, null, or any unexpected value
  • System was fail-open instead of fail-secure

Testing

Added comprehensive unit tests covering:

  • external_directory='allow' - proceeds without asking
  • external_directory='deny' - denies without asking
  • external_directory='ask' with approval - asks and proceeds
  • external_directory='ask' with denial - asks and denies

All 196 tests passing.

Fixes a systemic issue that could allow agents to bypass configured permission restrictions.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/4433 **State:** closed **Merged:** Yes --- ## Summary Fixes permission checks that were not properly enforcing deny settings, allowing operations to proceed when they should be blocked. ## Root Cause Permission checks across the codebase were using an insecure pattern: - Only checking for `"ask"` or specific values - Ignoring `"deny"` settings - Allowing operations when permission was `undefined`, `null`, or any unexpected value - System was fail-open instead of fail-secure ## Testing Added comprehensive unit tests covering: - `external_directory='allow'` - proceeds without asking - `external_directory='deny'` - denies without asking - `external_directory='ask'` with approval - asks and proceeds - `external_directory='ask'` with denial - asks and denies All 196 tests passing. Fixes a systemic issue that could allow agents to bypass configured permission restrictions.
yindo added the pull-request label 2026-02-16 18:15:44 -05:00
yindo closed this issue 2026-02-16 18:15:44 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10969