Back to skill

Security audit

Shell

Security checks for vulnerabilities and agentic risk

Overview

This is a shell scripting reference skill whose executable script only prints fixed help text and examples; the scanner warnings are explained by documented examples rather than active unsafe behavior.

Install this as a shell scripting reference, not as a safety sandbox. Some examples it displays, such as deleting files with `rm` or detaching processes with `nohup`, can be dangerous if copied into a real terminal without understanding the paths and effects.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (14)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 367)May include surrounding context.

sh
awk — Field Processing:
  awk '{print $1}' file          # First field (space-delimited)
  awk -F: '{print $1}' /etc/passwd  # Custom delimiter
  awk '$3 > 100' file            # Filter by field value
  awk '{sum+=$1} END{print sum}' # Sum a column
  awk 'NR==5,NR==10' file       # Lines 5-10

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 397)May include surrounding context.

sh
awk — Field Processing:
  awk '{print $1}' file          # First field (space-delimited)
  awk -F: '{print $1}' /etc/passwd  # Custom delimiter
  awk '$3 > 100' file            # Filter by field value
  awk '{sum+=$1} END{print sum}' # Sum a column
  awk 'NR==5,NR==10' file       # Lines 5-10

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/script.sh (reported line 381)May include surrounding context.

sh
find . -type f -exec chmod 644 {} \;  # Execute on each

xargs — Build Commands from Input:
  find . -name "*.log" | xargs rm          # Delete found files
  find . -name "*.log" -print0 | xargs -0 rm  # Handle spaces
  cat urls.txt | xargs -P 4 -I {} curl {}  # Parallel downloads

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/script.sh (reported line 382)May include surrounding context.

sh
xargs — Build Commands from Input:
  find . -name "*.log" | xargs rm          # Delete found files
  find . -name "*.log" -print0 | xargs -0 rm  # Handle spaces
  cat urls.txt | xargs -P 4 -I {} curl {}  # Parallel downloads

jq — JSON Processing:

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/script.sh (reported line 383)May include surrounding context.

sh
xargs — Build Commands from Input:
  find . -name "*.log" | xargs rm          # Delete found files
  find . -name "*.log" -print0 | xargs -0 rm  # Handle spaces
  cat urls.txt | xargs -P 4 -I {} curl {}  # Parallel downloads

jq — JSON Processing:
  echo '{"name":"Ada"}' | jq '.name'         # "Ada"

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/script.sh (reported line 422)May include surrounding context.

sh
trap — Catch Signals:
  # Cleanup on exit (any exit — normal or error)
  trap 'echo "Cleaning up..."; rm -f "$tmpfile"' EXIT

  # Catch Ctrl+C
  trap 'echo "Interrupted!"; exit 130' INT

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
80% confidence
Finding

Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Content

Scanner excerpt · scripts/script.sh (reported line 525)May include surrounding context.

sh
[ ] Network operations have timeouts

Code Quality:
  [ ] ShellCheck passes with no warnings
  [ ] Functions are small and focused
  [ ] Local variables used in functions
  [ ] No useless cat (use < file instead of cat file |)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill exposes shell command execution patterns via scripts/script.sh ... but does not declare any explicit tool scope such as permissions or allowed-tools. That omission weakens least-privilege controls because an agent or host system may permit broader shell access than intended, which is especially relevant for a shell-focused skill whose natural use case involves command execution.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/script.sh (reported line 378)May include surrounding context.

sh
find . -type f -mtime -7       # Modified in last 7 days
  find . -size +100M             # Larger than 100MB
  find . -name "*.tmp" -delete   # Find and delete
  find . -type f -exec chmod 644 {} \;  # Execute on each

xargs — Build Commands from Input:
  find . -name "*.log" | xargs rm          # Delete found files

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/script.sh (reported line 467)May include surrounding context.

sh
fg %1                  # Bring job 1 to foreground
  bg %1                  # Resume stopped job in background
  kill %1                # Kill job 1
  disown %1              # Detach job from shell

Parallel Execution:
  # Run commands in parallel, wait for all

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/script.sh (reported line 489)May include surrounding context.

sh
fg %1                  # Bring job 1 to foreground
  bg %1                  # Resume stopped job in background
  kill %1                # Kill job 1
  disown %1              # Detach job from shell

Parallel Execution:
  # Run commands in parallel, wait for all

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/script.sh (reported line 487)May include surrounding context.

sh
# GNU Parallel (more sophisticated)
  parallel -j4 process_file ::: *.csv

Nohup / Disown:
  nohup cmd &            # Survives terminal close (output → nohup.out)
  cmd & disown           # Detach from shell (no nohup.out)
  setsid cmd             # New session (fully detached)

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/script.sh (reported line 488)May include surrounding context.

sh
parallel -j4 process_file ::: *.csv

Nohup / Disown:
  nohup cmd &            # Survives terminal close (output → nohup.out)
  cmd & disown           # Detach from shell (no nohup.out)
  setsid cmd             # New session (fully detached)
EOF

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/script.sh (reported line 490)May include surrounding context.

sh
Nohup / Disown:
  nohup cmd &            # Survives terminal close (output → nohup.out)
  cmd & disown           # Detach from shell (no nohup.out)
  setsid cmd             # New session (fully detached)
EOF
}

Static analysis

No suspicious patterns detected.