Skip to content

Fix coding mode Git safety enforcement#14

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-investigation-64d6
Draft

Fix coding mode Git safety enforcement#14
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-investigation-64d6

Conversation

@cursor

@cursor cursor Bot commented Jun 17, 2026

Copy link
Copy Markdown

Bug and impact

  • Coding mode could execute disabled capabilities if a model emitted an unadvertised tool call/XML invoke while another coding tool category kept tool dispatch active.
  • The generic coding_run_command shell path allowed git push --force / force refspecs, bypassing the dedicated push tool's force-push protection and risking remote history loss.
  • Authenticated Git clone URL validation accepted http://, allowing a saved PAT to be sent over cleartext HTTP.

Root cause

  • Coding tool settings were only used when building advertised tool definitions, not enforced inside run_coding_tool.
  • Git safety checks were applied to the dedicated remote push helper but not to shell-invoked Git commands.
  • The HTTPS validator allowed both https:// and http:// despite PAT-backed Git operations requiring HTTPS.

Fix

  • Enforce coding tool category settings at execution time.
  • Block force-push flags/refspecs and global/system/worktree Git config from coding_run_command Git invocations.
  • Require Git remote URLs to start with https://.
  • Added regression tests for the safety policies.

Validation

  • cargo +stable test --manifest-path src-tauri/Cargo.toml validate_
  • cargo +stable test --manifest-path src-tauri/Cargo.toml coding_tools_fail_closed_without_settings
  • cargo +stable test --manifest-path src-tauri/Cargo.toml
Open in Web View Automation 

cursoragent and others added 2 commits June 17, 2026 10:10
Co-authored-by: g00sifer Development Lab <g00siferdev-py@users.noreply.github.com>
Co-authored-by: g00sifer Development Lab <g00siferdev-py@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.

1 participant