Skip to content

🔒 [security] guards: close env-check bypass, allow the run read helper - #66

Merged
EricTechPro merged 2 commits into
mainfrom
fix/guards-allowlist
Oct 19, 2026
Merged

EricTechPro merged 2 commits into
mainfrom
fix/guards-allowlist

Conversation

@EricTechPro

Copy link
Copy Markdown
Owner

Note

⏳ In review · ✅ 6/7 AC · Closes #48 · Closes #38 · head d3082ce

Problem

  • Where: hooks/guard-secrets.py → ENV_CHECK (🐛 [bug] guards: env-check allowlist lets a chained command read .env #48)
    • a. (?:\S*/)? let ;, $, {, } into the path prefix, so a second command rode along with the env-check call
    • b. \s and $ accepted a newline, a bash command separator
  • Where: skills/super-board/references/run-workflow.md → "Mid-run permission prompts" (🐛 [bug] run: fresh install can't start, read helper not allowed #38)
    • a. The allowlist onboard writes left out super-board-github-read.py (and verification-ready.py), so pre-flight stopped on a prompt
    • b. Writes to .claude/super-board/ (wave lock) are a Claude Code protected path; a headless acceptEdits run can't create the lock
  • Who: every project with the guard hooks; every fresh install running /super-board run

Solution

  • ENV_CHECK takes path characters only in the prefix, spaces/tabs as separators, \Z as the end
  • One deny test per bypass in tests/test-guard-hooks.sh, plus allow cases for direct, sh, tab and --file= calls
  • Base allowlist adds the read helper in both forms, verification-ready.py and stop.sh
  • New tests/test_run_allowlist.py checks every .claude/bin script called by run-workflow.md, the wave workflow and the lane skills is covered
  • run-workflow.md says claude -p "/super-board run" needs bypassPermissions in an isolated sandbox; otherwise run interactively and allow the .claude folder for the session. .claude/worktrees/ is exempt from protection
  • Docs: https://code.claude.com/docs/en/permission-modes#protected-paths — allow rules don't pre-approve protected-path writes

Acceptance criteria

  • Both 🐛 [bug] guards: env-check allowlist lets a chained command read .env #48 bypass commands return deny
    ↳ tests/test-guard-hooks.sh env-check cases; failed against origin/main's hook, pass now
  • Legit env-check calls (names only, --file with a local dotenv) still allow
    ↳ existing + new allow cases in tests/test-guard-hooks.sh
  • One deny case per bypass
    ↳ semicolon, substitution, brace, newline before/after/inside, trailing newline
  • Allowlist lists super-board-github-read.py in both forms
    ↳ run-workflow.md base list; onboard writes this list
  • A test asserts every pre-flight and lane script is allowlisted
    ↳ tests/test_run_allowlist.py (red before the doc fix)
  • run-workflow.md states whether claude -p "/super-board run" is supported
    ↳ "Headless runs" paragraph
  • A fresh install drains a headless wave
    ↳ not verified: needs a live dogfood run with bypassPermissions in a sandbox · Eric

Iteration history

Lane Done Time Details
🔨 builder ✅ Oct 18 bash tests/run-safety.sh → 58/58 suites · d3082ce

Risk

🟢 Low · regex narrowing (legit calls keep their shape) plus allowlist and docs.

🤖 Generated with Claude Code

EricTechPro and others added 2 commits October 18, 2026 11:23
… scan

- ENV_CHECK prefix takes path characters only, so ; $ { } can't smuggle a second command
- spaces/tabs separate words and \Z ends the match, so a newline can't chain a dotenv read
- one deny test per bypass (semicolon, substitution, brace, newlines) plus legit direct, sh, tab and --file= calls
Closes #48
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- base allowlist adds super-board-github-read.py (python3 and direct), verification-ready.py and stop.sh
- test_run_allowlist.py fails when pre-flight or a lane calls a .claude/bin script the list misses
- run-workflow.md: .claude/super-board/ is a protected path no allow rule covers; claude -p needs bypassPermissions in a sandbox, else run interactively
Closes #38
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@EricTechPro
EricTechPro merged commit d5ed2c3 into main Oct 19, 2026
13 checks passed
@EricTechPro
EricTechPro deleted the fix/guards-allowlist branch October 19, 2026 06:24
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.

🐛 [bug] guards: env-check allowlist lets a chained command read .env 🐛 [bug] run: fresh install can't start, read helper not allowed

1 participant