Skip to content

fix(hooks): cap PONYTAIL_SUBAGENT_MATCHER length, warn on stderr - #704

Open
veltri-23 wants to merge 1 commit into
DietrichGebert:mainfrom
veltri-23:fix/658-regex-validation
Open

fix(hooks): cap PONYTAIL_SUBAGENT_MATCHER length, warn on stderr#704
veltri-23 wants to merge 1 commit into
DietrichGebert:mainfrom
veltri-23:fix/658-regex-validation

Conversation

@veltri-23

Copy link
Copy Markdown

Slim replacement for #686 (closed after maintainer feedback: the 200-line ReDoS parser was more machinery than an operator-set env var deserves).

What's left:

  • PONYTAIL_SUBAGENT_MATCHER over 256 chars: ignored with a stderr warning, fail-open (inject everywhere)
  • invalid regex: stderr warning on top of the existing try/catch fail-open
  • tests: invalid warns, 256/257 boundary, overlong warns

51 insertions, 4 deletions across 3 files (hooks/ponytail-subagent.js, tests/hooks.test.js, README.md). Rebased on current main.

Signed-off-by: Hunter Veltri <veltrifinancial@gmail.com>
@veltri-23

Copy link
Copy Markdown
Author

@DietrichGebert Tagging for visibility since GH didn't allow me to reopen the closed PR. I made the changes from #686 you requested.

TIA!

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.

1 participant