Skip to content

AAK-HOOK-005: Hook command uses base64 encoding/decoding

Severity
HIGH
Category
Hook Injection (hook-injection)
Scanner
agent_audit_kit/scanners/hook_injection.py
Auto-fixable
No.
SARIF name
HookBase64Obfuscation

What it detects

A hook command contains base64 operations, commonly used to obfuscate exfiltration payloads or encode stolen credentials.

How to fix

Remove base64 operations from hooks unless there's a documented, legitimate use case.

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

agent-audit-kit scan . --rules AAK-HOOK-005

Limitations

Matches the words base64, btoa, atob, b64encode and b64decode in a hook command. Other encodings that hide a payload the same way, hex through xxd -r -p or base32 -d, are not matched. Hooks a plugin declares in .claude-plugin/plugin.json and hooks in a subagent's frontmatter are not read.

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-HOOK-005.md: the page then shows that text, with the registry reference appended under it.