Skip to content

fix(config): ignore permission grants from untrusted project settings - #3415

Open
Yeachan-Heo wants to merge 3 commits into
mainfrom
fix/3414-untrusted-project-permissions
Open

Yeachan-Heo wants to merge 3 commits into
mainfrom
fix/3414-untrusted-project-permissions

Conversation

@Yeachan-Heo

Copy link
Copy Markdown
Contributor

Fixes #3414

This PR strips permissions.allow and permissions.defaultMode from project-local settings files (.claw.json, .claw/settings.json) to prevent privilege escalation through shared repository configuration.

Changes:

  • Generalized strip_untrusted_project_hooks to strip_untrusted_project_settings
  • Strips permissions.allow and permissions.defaultMode from Project-source configs
  • Keeps restrictive permissions (deny, ask) from project files
  • Added comprehensive test verifying project permission stripping
  • Updated documentation in USAGE.md

Note: DO NOT MERGE - this changes behavior for teams that commit shared allow rules, so it needs owner sign-off on the policy (see #3414).

Strip permissions.allow and permissions.defaultMode from project-local
config files (.claw.json, .claw/settings.json) to prevent privilege
escalation. Keep restrictive permissions (deny, ask) from project files.

Add test verifying that project-granted permissions do not reach runtime.
Document untrusted project settings behavior in USAGE.md.

Fixes #3414
@Yeachan-Heo

Copy link
Copy Markdown
Contributor Author

Ready; held for owner sign-off on the policy (see #3414)

clawdbot added 2 commits November 29, 2026 03:06
…ject settings

A project .claw.json could still set "permissionMode": "danger-full-access",
which permission_mode() reads before permissions.defaultMode.
Project-scope permissionMode is now ignored, so the prompt rendering
fixtures use .claw/settings.local.json.
@Yeachan-Heo

Copy link
Copy Markdown
Contributor Author

Monitor fix-forward on top of eef0938:

  • f64bd3f: also strip the legacy top-level permissionMode from Project sources. permission_mode() (config.rs:2069) reads it before permissions.defaultMode, so a repo .claw.json with "permissionMode": "danger-full-access" still escalated. New test project_config_legacy_permission_mode_cannot_escalate fails without the strip (left: Some(DangerFullAccess)) and passes with it. USAGE.md updated.
  • cf4cc72: two prompt rendering tests used a project .claw/settings.json permissionMode fixture; moved them to .claw/settings.local.json.

All 7 checks pass at cf4cc72. Still held for owner sign-off on the policy (#3414), since teams that commit shared permissions.allow lose those grants.

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.

Project-scope .claw settings can grant tool allow rules and a permission mode to an untrusted repository

1 participant