News · DiggingBeagle record

Seven agent policy hooks could miss prohibited long commands because grep exited early

A maintainer advisory documents a shell-pipeline failure in pmo-platform PreToolUse hooks, where SIGPIPE under pipefail produced an incorrect allow result. Version 5.13.1 contains the fix; no production exploitation was established.

Published
Nov 23, 2026

The report

Seven PreToolUse policy hooks in the pmo-platform project could fail to recognize a prohibited command when an agent supplied a sufficiently long multiline command. The problem was not that the agent successfully argued against the rules. It was a shell-pipeline error: a matcher exited after finding a pattern, the writer received SIGPIPE, and pipefail turned an apparently successful match into a failing pipeline result.

The maintainer advisory, disclosed in November 2026, documents controlled reproductions involving roughly 96 KB of command text. It identifies affected versions from 1.05 up to but not including 5.13.1, where the project changed the implementation. The maintainer reports a larger passing test suite after the repair; those tests are patch evidence, not an independently observed production incident.

The implementation changed the meaning of a match

A policy intended to block a command string effectively asked two programs to cooperate. grep -q can terminate as soon as it finds the requested pattern. If printf continues trying to write the rest of a long payload, its write end may fail even though the forbidden text was present. Under the original interpretation of the pipeline exit status, this operational error was treated as a negative policy finding.

In a tool-driven agent workflow, that is a dangerous failure mode because the assistant's command may be long enough to trigger implementation behavior that was never considered part of the authorization decision. The prompt can remain unchanged and the high-level rule can be correct while the enforcing hook returns the wrong answer.

Scope and control

This advisory concerns a particular project's hooks, not a demonstrated defect in Claude Code's core security implementation or a general bypass of all PreToolUse mechanisms. The strongest correction is to give the matcher reliable access to the complete input and distinguish an actual no-match from a read or execution failure. An enforcement system should not silently convert an internal checker error into permission to run a host action. The Case records the affected versions and evidence limit.

Research behind this