Skip to content

AAK-POLICY-TRUNCATION-001: Deny policy evaluated on a truncated copy of the value the executor receives

Severity
HIGH
Category
Trust Boundaries (trust-boundary)
Scanner
agent_audit_kit/scanners/policy_truncation.py
Auto-fixable
No.
SARIF name
DenyPolicyTruncationBypass

What it detects

A hook bridge, gateway or guard cuts a candidate command, URL or path to a fixed length "for matching", evaluates its deny / block patterns against the cut copy, and hands the full untruncated value to whatever executes it. Everything past the cut point is invisible to the policy and visible to the executor, so a caller simply positions the dangerous part after the bound and the hard-deny list never sees it. The disclosed instance is CVE-2026-73614 (Network-AI ClaudeHookBridge < 5.15.1, CVSS 8.8): the target string is truncated to 500 characters before denyPatterns are evaluated while Claude Code executes the full Bash command field. That package is not pinnable — it resolves on neither npm nor PyPI and its GitHub repository 404s — so this rule is written against the shape rather than the vendor, and applies to any policy code with the same asymmetry. It fires only when the untruncated source is still referenced elsewhere in the file, which is what separates a policy/executor split from ordinary display truncation.

How to fix

Evaluate the policy against exactly the value the executor receives. If a length bound is needed to cap matching cost, reject over-long input outright rather than matching a prefix of it — a truncated match is a decision made on data that is not what runs. Where the check and the execution live in different components, pass one canonical value between them instead of letting each derive its own.

To confirm the finding is gone, report only this rule:

agent-audit-kit scan . --rules AAK-POLICY-TRUNCATION-001

Limitations

Looks for x = y.slice(0, 500) (or substring, substr) or x = y[:500] with a numeric literal of two or more digits, tested within 400 characters of a name that contains deny or block and then ends in Pattern, List, Rule, Match, Regex or s (denyPatterns, bashDenyList, DENY_PATTERNS, blockedList) or contains forbidden, disallow, blacklist or hard-deny, while y is still used untruncated. A bound held in a constant (slice(0, MAX_MATCH_LEN)), a slice written y[0:500] and a list named deniedPatterns are not matched.

References


All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-POLICY-TRUNCATION-001.md: the page then shows that text, with the registry reference appended under it.