Skip to content

fix(hooks): block shell separator bypasses and support wrapper stacking in block-monk fallback regex - #475

Open
seb4ez wants to merge 2 commits into
monk-io:mainfrom
seb4ez:fix/block-monk-fallback-regex-471
Open

fix(hooks): block shell separator bypasses and support wrapper stacking in block-monk fallback regex#475
seb4ez wants to merge 2 commits into
monk-io:mainfrom
seb4ez:fix/block-monk-fallback-regex-471

Conversation

@seb4ez

@seb4ez seb4ez commented Aug 31, 2026

Copy link
Copy Markdown

Fixes #471

Bounty eligibility

  • I signed up for the Monk.io bug bounty at https://monk.io/bug-bounty with this GitHub account
  • I used the installed Monk product end-to-end for this reproduction
  • I starred monk-io/monk-plugin

Summary

In hooks/block-monk.sh and hooks/block-monk.ps1, the fallback regex previously used trailing boundary (\s|$), allowing shell-separated invocations (monk;ls, monk&ls, monk|ls, monk&&ls, (monk)) to slip past the safety guard. Additionally,
ice was missing from the Windows wrapper list and stacked wrappers were unhandled.

Changes

  • Extended trailing regex boundary to catch all shell separators, redirections, and subshells.
  • Supported stacked wrapper execution (e.g. sudo nice monk).
  • Added
    ice wrapper to hooks/block-monk.ps1.
  • Verified 0 false positives for non-monk tools (e.g. monkey, git, pnpm).

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 bounty] PreToolUse block-monk fallback regex bypassed by shell separators (monk; / monk& / monk|)

1 participant