Normalize agent hook system event trust handling#64372
Conversation
Greptile SummaryThis PR closes two security gaps in Confidence Score: 5/5Safe to merge — narrowly scoped security fix consistent with existing patterns, well-tested, no regressions expected. Both changes (sanitization and trust-flag) are correct, minimal, and aligned with the already-fixed dispatchWakeHook path. sanitizeInboundSystemTags handles the relevant injection patterns; trusted?: boolean is a valid SystemEventOptions field; value.name is always a non-null string by the time it reaches dispatchAgentHook. Tests cover the two new behaviors and use vi.waitFor appropriately for the async IIFE. No unresolved P0/P1 findings. No files require special attention. Reviews (2): Last reviewed commit: "fix(hooks): sanitize agent hook system e..." | Re-trigger Greptile |
|
@codex review |
|
@greptile review |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
8e68e91 to
22e3a07
Compare
22e3a07 to
00ef0be
Compare
* fix(hooks): sanitize agent hook system events Co-authored-by: zsx <[email protected]> * chore(changelog): add agent hook trust normalization entry --------- Co-authored-by: zsx <[email protected]> Co-authored-by: Devin Robison <[email protected]>
* fix(hooks): sanitize agent hook system events Co-authored-by: zsx <[email protected]> * chore(changelog): add agent hook trust normalization entry --------- Co-authored-by: zsx <[email protected]> Co-authored-by: Devin Robison <[email protected]>
* fix(hooks): sanitize agent hook system events Co-authored-by: zsx <[email protected]> * chore(changelog): add agent hook trust normalization entry --------- Co-authored-by: zsx <[email protected]> Co-authored-by: Devin Robison <[email protected]>
* fix(hooks): sanitize agent hook system events Co-authored-by: zsx <[email protected]> * chore(changelog): add agent hook trust normalization entry --------- Co-authored-by: zsx <[email protected]> Co-authored-by: Devin Robison <[email protected]>
* fix(hooks): sanitize agent hook system events Co-authored-by: zsx <[email protected]> * chore(changelog): add agent hook trust normalization entry --------- Co-authored-by: zsx <[email protected]> Co-authored-by: Devin Robison <[email protected]>
Summary
Changes
src/gateway/server/hooks.tsto sanitize agent hook names before composing system event texttrusted: falseValidation
corepack pnpm installcorepack pnpm test src/gateway/server/hooks.agent-trust.test.tscorepack pnpm test src/gateway/server.hooks.test.tsclaude -p "/review"and addressed the review outcome before opening this PRNotes