Skip to content

Harden deny.cli wrapper generation - #34

Open
mrjf with Copilot wants to merge 7 commits into
mainfrom
copilot/critical-fix-eval-injection
Open

Harden deny.cli wrapper generation#34
mrjf with Copilot wants to merge 7 commits into
mainfrom
copilot/critical-fix-eval-injection

Conversation

Copilot AI commented May 16, 2026

Copy link
Copy Markdown
Contributor

deny.cli patterns were embedded in generated bash wrappers with insufficient quoting and then evaluated with eval, allowing a malicious BAND.md pattern like foo$(...) * to execute during wrapper parsing.

  • Wrapper generation
    • Replaces double-quoted pattern interpolation with single-quoted shell literals.
    • Removes eval from deny checks.
    • Keeps intended bash glob matching for deny patterns.
for P in "${DENY_PATTERNS[@]}"; do
  if [[ "$FULL_CMD" == $P ]]; then
    echo "DENIED: $FULL_CMD" >&2
    exit 126
  fi
done
  • Regression coverage
    • Adds unit coverage for command substitution payloads in deny.cli.
    • Verifies generated wrappers preserve metacharacters as data and do not execute them.

Copilot AI linked an issue May 16, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix eval injection in deny.cli wrapper generation Harden deny.cli wrapper generation May 16, 2026
Copilot AI requested a review from mrjf May 16, 2026 14:20
Copilot finished work on behalf of mrjf May 16, 2026 14:20
@mrjf

mrjf commented May 16, 2026

Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request and fix tests

Copilot AI commented May 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request and fix tests

Resolved the merge conflicts and pushed merge commit d36b465. Validation passed: targeted band-server tests, typecheck, full bun run test, secret scan, and CodeQL (0 alerts).

Copilot finished work on behalf of mrjf May 16, 2026 17:25
@mrjf
mrjf marked this pull request as ready for review May 21, 2026 14:09
@mrjf

mrjf commented May 21, 2026

Copy link
Copy Markdown
Owner

@copilot resolve the merge conflicts in this pull request

Copilot AI commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Resolved the merge conflicts and pushed merge commit 871058a. Validation passed: targeted runtime tests, bun run typecheck, bun run build, full bun run test, secret scan, and CodeQL (0 alerts).

Copilot finished work on behalf of mrjf May 21, 2026 14:18
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.

Critical: eval injection in deny.cli wrapper generation

2 participants