Skip to content

fix(guardrails): report when check-bash-file-changes skips or truncates #6709

Closed

Description

@kyle-sexton

Refs: #6690

Problem

plugins/guardrails/hooks/check-bash-file-changes.mjs stays silent when it does not examine a change, so a reader of its output cannot tell "checked and clean" from "not checked". A security review of #6708 found:

  • It examines at most 20 changed files, sorted by path (MAX_FILES, ~line 383): touch a{01..20} && echo PAYLOAD > zz.sh leaves zz.sh unexamined.
  • git status returning more than MAX_STATUS_ENTRIES (~line 139), or running past the time budget (~line 391), skips the whole check.
  • A Bash call with run_in_background: true writes after the PostToolUse check has run.
  • A file written and then deleted in the same command, or a newly created symlink (lstat skip, ~line 276), is never examined.
  • The snapshot can silently fail (status timeout, hook timeout, a failed write to the data directory), and the check then has nothing to compare.

Proposed

Report every truncation or skip in the hook's output ("N changed files not examined: ") instead of exiting quietly, and report newly appeared untracked symlinks. Land the must-report tests first.

🤖 Generated with Claude Code

Activity

  1. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 10, 2026
  2. github-actions commented on Oct 10, 2026

    @github-actions
    Contributor

    Thanks for the report. This describes several cases where plugins/guardrails/hooks/check-bash-file-changes.mjs exits quietly instead of noting that a change went unexamined: files past the 20-file cap, a git status over the entry limit or past the time budget, background-command writes, a create-then-delete or new symlink, and a failed snapshot. The proposed fix is to surface each skip or truncation in the hook's output ("N changed files not examined: ") and to report newly appeared untracked symlinks, with must-report tests landing first.

    The report is specific (file, approximate line numbers, and a concrete repro for the file-cap case) and references the originating issue (#6690) and the review that found it (#6708). I didn't find an existing open issue duplicating this one; #6689 is a related but distinct follow-up about narrowing block-hook-bypass rather than this hook's reporting.

    No missing information that I can see.

    Automated triage. A maintainer reviews it.

  3. added
    area: securitySecurity-relevant: vulnerability, hardening, or disclosure follow-up.
    priority: mediumReal value, no hard deadline; normal backlog flow.
    on Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: securitySecurity-relevant: vulnerability, hardening, or disclosure follow-up.needs-triageNot yet classified. Floor until a type and one priority tier are set.priority: mediumReal value, no hard deadline; normal backlog flow.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions