Skip to content

fix: permission checks for external_directory and doom_loop - #4433

Merged
rekram1-node merged 3 commits into
anomalyco:devfrom
aeriondyseti:fix/critical-permission-security
Nov 18, 2025
Merged

rekram1-node merged 3 commits into
anomalyco:devfrom
aeriondyseti:fix/critical-permission-security

Conversation

@aeriondyseti

Copy link
Copy Markdown
Contributor

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.

@rekram1-node

Copy link
Copy Markdown
Collaborator

Thank u for spotting this, will tweak it and merge it, currently cant due to github outage

@rekram1-node
rekram1-node force-pushed the fix/critical-permission-security branch from 8b61430 to f0fa213 Compare November 18, 2025 22:31
@rekram1-node rekram1-node changed the title fix: permission checks not enforcing deny settings fix: permission checks for external_directory and doom_loop Nov 18, 2025
@rekram1-node
rekram1-node merged commit 47bfae5 into anomalyco:dev Nov 18, 2025
3 checks passed
@aeriondyseti

Copy link
Copy Markdown
Contributor Author

Just to confirm: this current code path is "fail open" which means that if they leave it empty or put any value other than "ask" or "deny", it will automatically approve. I just want to make sure that's intended.

@rekram1-node

Copy link
Copy Markdown
Collaborator

If you don't set it, it automatically asks as intended

If you set it to allow it will allow

Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
…o#4433)

Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
Co-authored-by: AerionDyseti <AerionDyseti@users.noreply.github.com>
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
…o#4433)

Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
Co-authored-by: AerionDyseti <AerionDyseti@users.noreply.github.com>
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
…o#4433)

Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
Co-authored-by: AerionDyseti <AerionDyseti@users.noreply.github.com>
MarsQiu007 referenced this pull request in MarsQiu007/openNovel Jul 31, 2026
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
Co-authored-by: AerionDyseti <AerionDyseti@users.noreply.github.com>
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
…o#4433)

Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
Co-authored-by: AerionDyseti <AerionDyseti@users.noreply.github.com>
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