bash permissions: deny rules catch capitalised program names on macOS

AF
2h ago
+306-51

macOS (and Windows) find programs whatever the letter case, so Git push --force runs git, but OpenCode matches rule patterns case-sensitively, so a deny rule git push* didn't apply.

  • The scanner hands the host the line with the program's basename in lower case first, then the original spelling, on macOS and Windows. A deny written for either spelling still applies. Linux is unchanged.
  • xargs and the synthetic-load guard's launchers are recognised under any letter case on those platforms.
  • The bridge's refusal attribution matches case-insensitively on darwin too, so the message names the rule the host applied.

An allow rule that names only one spelling can now ask once for a mixed-case command.

Found by an internal security review of the bash permission scanner. Red-first tests in Rust and TypeScript (platform injected). Linux bash-permission tests and the Windows lib check pass.


Summary by cubic

Fixes the bash permission scanner so deny rules catch mixed-case program names on macOS and Windows, where filesystems are case-insensitive but rule matching was case-sensitive.

  • The host gets the executable's basename in lowercase before the original spelling on macOS and Windows; Linux is unchanged.
  • xargs and synthetic-load guard launchers are recognized under any ASCII letter case, and launcher options are read under the folded name so Caffeinate -i yes no longer slips past.
  • Non-ASCII program names are unreadable on macOS and Windows since their spellings can run a different program; readable commands on the same line keep their own asks, so deny rules still apply to them.
  • File commands get outside-the-project asks under any ASCII letter case.
  • Bridge refusal attribution mirrors the host again: case-insensitive only on Windows, since the scanner already sends a lowercase variant on macOS.
  • Allow rules that name only one spelling can now ask once for a mixed-case command.

Found by an internal security review of the bash permission scanner; covered by red-first Rust and TypeScript tests with platform injection. The Windows memory-cap test now waits 30 s for capped processes to exit and reports job membership if one survives.

Confidence Score: 5/5RetriggerView in Greptile

The PR appears safe to merge; no actionable new issues remain.

Summary

The PR checks lowercase and original executable spellings on macOS and Windows so mixed-case names match deny rules.

  • Bash permission checks match mixed-case program names on macOS and Windows.
  • The load guard recognizes mixed-case launchers on macOS and Windows.
  • Refusal messages follow the host’s command-matching rules.
  • Review support gives Windows cleanup tests more time and adds a benchmark slice.

All three earlier findings remain fixed. No new actionable issues were found in the latest change.

Reviews (5) · Last reviewed commit: "test: Windows memory-cap test waits 30 s..." · Reviewed by Greptile