Skip to content

Normalize protected programs and read PowerShell launches (T51) - #214

Merged
erickb336 merged 6 commits into
mainfrom
codex/t51-command-identities
Oct 14, 2026
Merged

erickb336 merged 6 commits into
mainfrom
codex/t51-command-identities

Conversation

@erickb336

@erickb336 erickb336 commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Closes #97
Sage task T51

Protected commands retain their restrictions when executable names use mixed case, full paths or .exe. The active hook uses the same rules for stash, process tools, readers and writers.

The shared reader exposes literal PowerShell Start-Process/start children, including FilePath and ArgumentList in either order. Direct PowerShell inputs and nested powershell/pwsh commands carry explicit context. The specified backslash-before-double-quote ambiguity involving git or gh refuses. Supported forms and limits are in packages/sage-core/powershell-launch.md.

Shell syntax, same-shell builtin lookup and external executable identity remain distinct. Genuine builtin chains retain their children. An external command executable retains its identity; a separate refusal-only check examines literal operand chains for protected expansions and API writes. It grants no permission and does not evaluate external eval text or function arguments.

Head: 9f830b9cc93b1d1285e374b54236f1bca29fa9e5, including main f6e04a3 and merged #215.

Validation:

  • npm run build: generated provider copies committed.
  • npm run check: all checks pass.
  • Focused repair checks: tests 14, pass 14, fail 0, including all six existing regressions found by the earlier full suite and CI.
  • Seven new tests copied unchanged to detached main f6e04a3: tests 7, pass 0, fail 7. Their first failures cover external command identity, native-wrapper boundaries, external eval identity, uppercase stash, PowerShell child arguments and quoting ambiguity. A matrix's first failure does not prove each row failed independently.
  • The two new refusal tests also fail the preceding implementation 92a677e at the missing-refusal assertions. Function-data controls reproduced failures before their fix. Existing T199, T29, R466 and checkout-path assertions remain unchanged.
  • Two clean code/security/QA review cycles on this final head.
  • Final-head npm test -- --test-concurrency=1: tests 1209, pass 1209, fail 0, cancelled 0, skipped 0.
  • Exact-head CI run 38506757155: success; tests 1209, pass 1209, fail 0.

The earlier full suite and CI exposed six refusal regressions that clean source reviews missed. This head repairs them and passes both final full checks.

All tests use fake ps, pgrep and kill first on PATH. Candidate commands reach parser/handle only; no attack command or real PowerShell process ran. Actual PowerShell execution and complete shell/sandbox enforcement remain unverified. This does not enable installed automatic Sage or resolve required-hook outage behavior. Claude #140's active lead/report changes remain untouched.

@erickb336
erickb336 marked this pull request as ready for review October 14, 2026 03:43
@erickb336
erickb336 merged commit 1f8034f into main Oct 14, 2026
1 check passed
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.

Hook: program names without case, PowerShell Start-Process and a quoting trick reach the upload and stash rules (pre-existing, high)

1 participant