open-swe/agent
Adam Moussa 7ec08d1870
fix(workflow-guard): close residual approval bypasses (H1/H3/H6)
Harden the workflow-push approval guard against three bypasses found by the
security review:

- H6: the push parser passed through (returned None, unguarded) git invoked via
  a path (`/usr/bin/git`), a wrapper (`command`/`env` ...), or with leading
  global options (`git -c`, `--git-dir`, `--no-pager`). Recognize wrapped and
  path-qualified git as pushes, and block pushes carrying unsupported global
  options instead of running them unguarded.
- H1: the base was fetched via the `origin` remote name, which the sandbox can
  split from the push destination via `remote set-url --push`. Fetch the base
  from the effective push URL (`git remote get-url --push`) so the base and the
  push target are the same authenticated repo.
- H3: an unreadable head workflow tree (`ls-tree` failure) skipped the guard;
  fail closed (block) instead, mirroring the base-read path.

Adds tests for each. All confirmed guard bypasses are caught by the langsmith
unelevated-token backstop today; these close the guard's own logic for
non-langsmith providers too.

Claude-Session: https://claude.ai/code/session_01GxSndB7VoGQyeS196eUr5E
2026-07-01 18:04:22 -04:00
..
dashboard Key workflow approval on head workflow tree and block unsafe pushes 2026-07-01 20:58:07 +00:00
integrations chore: sync upstream/main, defer #1621 modular webhooks (#81) 2026-06-30 16:45:19 -04:00
middleware fix(workflow-guard): close residual approval bypasses (H1/H3/H6) 2026-07-01 18:04:22 -04:00
skills feat: outcomes dataset + bootstrap/continual split via skills (#1365) 2026-06-01 13:25:12 -07:00
tools refactor: adopt modular webhook architecture (#1621) + port fork customizations (#85) 2026-06-30 18:46:46 -04:00
utils refactor: adopt modular webhook architecture (#1621) + port fork customizations (#85) 2026-06-30 18:46:46 -04:00
webhooks refactor: adopt modular webhook architecture (#1621) + port fork customizations (#85) 2026-06-30 18:46:46 -04:00
analyzer.py feat: route graphs to separate LangSmith tracing projects (#1508) 2026-06-11 17:57:16 -07:00
chat.py feat: chat with your PR on the review page (#1534) 2026-06-15 17:17:30 -07:00
ci_autofix.py refactor: adopt modular webhook architecture (#1621) + port fork customizations (#85) 2026-06-30 18:46:46 -04:00
ci_monitor.py feat: CI auto-fix and PR babysitting for agent PRs (#1530) 2026-06-15 13:53:50 -07:00
completion.py refactor: adopt modular webhook architecture (#1621) + port fork customizations (#85) 2026-06-30 18:46:46 -04:00
dispatch.py refactor: adopt modular webhook architecture (#1621) + port fork customizations (#85) 2026-06-30 18:46:46 -04:00
encryption.py feat: support TOKEN_ENCRYPTION_KEY rotation via MultiFernet [closes AB-2323] (#1275) 2026-05-08 14:29:23 -07:00
prompt.py Key workflow approval on head workflow tree and block unsafe pushes 2026-07-01 20:58:07 +00:00
reconcile.py refactor: adopt modular webhook architecture (#1621) + port fork customizations (#85) 2026-06-30 18:46:46 -04:00
review_style_collector.py feat: PR review page (#1495) 2026-06-11 16:11:10 -07:00
review_style_guidance.py feat: tune reviewer for precision — web/wiki tools + recalibrated prompt (#1312) 2026-05-20 18:35:00 +00:00
reviewer.py chore: sync upstream/main, defer #1621 modular webhooks (#81) 2026-06-30 16:45:19 -04:00
reviewer_diff.py fix: reviewer reviews full diff; fix review UI scroll + dark-mode composer (#1575) 2026-06-18 19:24:52 -07:00
reviewer_eval_store.py feat: Run reviewer eval in a GitHub Action; dashboard becomes read-only (#1556) 2026-06-16 19:38:36 -07:00
reviewer_findings.py fix: Reviews tab — anchored finding card, paginated list, file tree truncation (#1507) 2026-06-11 17:52:20 -07:00
reviewer_groups.py fix: Simplify review explanation: full-width, plain prose, no diff links (#1547) 2026-06-16 15:32:24 -07:00
reviewer_publish.py chore: sync upstream/main, defer #1621 modular webhooks (#81) 2026-06-30 16:45:19 -04:00
reviewer_reconcile.py chore: sync upstream/main, defer #1621 modular webhooks (#81) 2026-06-30 16:45:19 -04:00
reviewer_trace_context.py chore: sync upstream/main, defer #1621 modular webhooks (#81) 2026-06-30 16:45:19 -04:00
scheduler.py refactor: adopt modular webhook architecture (#1621) + port fork customizations (#85) 2026-06-30 18:46:46 -04:00
server.py feat: post scheduled-run report to a configured Slack channel (#83) 2026-06-30 17:34:52 -04:00
webapp.py refactor: adopt modular webhook architecture (#1621) + port fork customizations (#85) 2026-06-30 18:46:46 -04:00