claude-code-bash-patterns
Fail
Audited by Gen Agent Trust Hub on Feb 16, 2026
Risk Level: HIGHCREDENTIALS_UNSAFEDATA_EXFILTRATIONCOMMAND_EXECUTION
Full Analysis
- [CREDENTIALS_UNSAFE] (HIGH):
SKILL.mdcontains a hardcoded API key patternexport API_KEY="sk-...". Although intended as a 'Session Persistence' example, providing specific secret prefixes likesk-can lead to accidental exposure if the agent or user follows the pattern literally. - [DATA_EXFILTRATION] (MEDIUM): The
scripts/bash-audit-logger.shscript records all bash commands to~/.claude/bash-audit.log. Since the agent often handles secrets (API keys, passwords) in command arguments or environment variables, this creates a local file containing highly sensitive unencrypted data. - [COMMAND_EXECUTION] (HIGH): The skill promotes a 'hook' architecture where arbitrary shell commands and Python scripts are executed before and after every tool call. The examples in
templates/settings.jsonuse shell interpolation ($CLAUDE_TOOL_INPUT) to perform logic, which is a complex execution surface prone to bypass or unintended behavior. - [INDIRECT_PROMPT_INJECTION] (HIGH): The security guards provided (
dangerous-command-guard.py) rely on regular expressions to block 'dangerous' commands. This is a fragile defense-in-depth mechanism that can be bypassed using shell obfuscation techniques (e.g.,r''m -''rf /) or indirect injection where the agent is manipulated into generating a command that evades the specific regex patterns. - Ingestion points:
CLAUDE_TOOL_INPUTenvironment variable and standard input are used to pass tool data to hook scripts. - Boundary markers: Absent. Untrusted command strings are processed directly.
- Capability inventory: The skill facilitates full Bash execution, file writing, and tool orchestration.
- Sanitization: Uses
jqfor JSON parsing, but the actual command content is evaluated via regex without semantic sanitization.
Recommendations
- AI detected serious security threats
Audit Metadata