Back to skill

Security audit

Canary Deploy

Security checks for vulnerabilities and agentic risk

Overview

The skill is meant to make risky system changes safer, but its rollback and command wrapper can affect privileged system files in unsafe, under-scoped ways.

Review this skill carefully before installing. It should only be used by a trusted operator on systems where they understand the sudo impact, and it should not be treated as reliable protection against remote lockout. Do not run rollback unless the backup directory and path metadata are trusted, and avoid feeding generated, remote, or partially trusted text into the command or validation arguments.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/canary-test.sh:141
Finding

Privileged Arbitrary File Overwrite Through Predictable Temporary Storage

Content
View full analysis
/dev/null)" ]; then for f in "$BACKUP_DIR"/*; do ORIGINAL=$(cat "$f.path" 2>/dev/null || echo "") if [ -n "$ORIGINAL" ] && [ -f "$f" ]; then sudo cp "$f" "$ORIGINAL" echo " ✅ Restored: $ORIGINAL" fi done ``` The corresponding backup creation logic is: ```bash CANARY_DIR="${CANARY_DIR:-/tmp/canary-deploy}" BACKUP_DIR="$CANARY_DIR/backups" mkdir -p "$CANARY_DIR" "$BACKUP_DIR" for f in "${BACKUP_FILES[@]}"; do if [ -f "$f" ]; then SAFE_NAME=$(echo "$f" | tr '/' '_') cp "$f" "$BACKUP_DIR/$SAFE_NAME" echo "$f" > "$BACKUP_DIR/$SAFE_NAME.path" echo " ✅ Backed up: $f" else echo " ⚠️ File not found: $f" fi done ``` ### Technical Analysis The scripts use the fixed, globally predictable path `/tmp/canary-deploy` for backup data and destination metadata. They create this path with `mkdir -p` but do not verify: - Whether the directory existed before execution. - Whether it is owned by the current trusted user. - Whether its permissions prevent modification by other local users. - Whether any component is a symbolic link. - Whether backup files and `.path` metadata are regular, trusted files. - Whether a rollback destination belongs to the set of files backed up during the current operation. Rollback treats the contents of `"$f.path"` as an authoritative destination and passes that value to `sudo cp`. This creates ...[truncated 2289 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/critical-update.sh:79
Finding

Arbitrary Shell Command Execution Through eval-Based Command Processing

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill markets itself as a safety mechanism for risky infrastructure changes, but the documented behavior appears to overclaim what it actually verifies and restores. That mismatch is dangerous because operators may rely on it to prevent lockout or enable rollback during SSH, firewall, or network changes when it may only capture local state and restore limited files, creating a false sense of safety during high-risk operations.

Content

No source excerpt is available for this finding.

Chaining Abuse

High
Category
Tool Misuse
Confidence
84% confidence
Finding

The example chains multiple privileged operations with shell control operators inside a single command string. This increases blast radius and makes failures, quoting mistakes, and injection opportunities harder to reason about, especially if any part of the command is assembled dynamically by users or calling agents.

Content

Scanner excerpt · SKILL.md (reported line 45)May include surrounding context.

bash scripts/critical-update.sh
--name "SSH hardening"
--backup "/etc/ssh/sshd_config"
--command "sudo sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config && sudo systemctl reload sshd"
--validate "ssh -o ConnectTimeout=5 localhost echo ok"

text

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script advertises rollback support and references backup/path metadata, but it never creates those backups or the corresponding .path files. In a tool intended to protect critical infrastructure changes, this creates a dangerous false sense of safety: operators may proceed with risky SSH, firewall, or network modifications believing recovery is available when it is not.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · SKILL.md (reported line 29)May include surrounding context.

md
bash scripts/canary-test.sh baseline

# Make your change
sudo nano /etc/ssh/sshd_config

# Validate change didn't break anything
bash scripts/canary-test.sh validate

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/canary-test.sh (reported line 44)May include surrounding context.

sh
bash scripts/canary-test.sh baseline

# Make your change
sudo nano /etc/ssh/sshd_config

# Validate change didn't break anything
bash scripts/canary-test.sh validate

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
82% confidence
Finding

The skill encourages passing a root-level shell command as a quoted --command argument, which is a dangerous execution pattern because it normalizes arbitrary privileged command strings inside an automation wrapper. If untrusted input reaches that argument or users copy-modify examples unsafely, it can result in unintended command execution as root and destructive system changes.

Content

Scanner excerpt · SKILL.md (reported line 45)May include surrounding context.

bash scripts/critical-update.sh
--name "SSH hardening"
--backup "/etc/ssh/sshd_config"
--command "sudo sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config && sudo systemctl reload sshd"
--validate "ssh -o ConnectTimeout=5 localhost echo ok"

text

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill claims to prevent lockouts by validating connectivity before and after changes, but it only tests localhost SSH and external DNS resolution. Those checks do not validate actual remote reachability from the operator's network path, so a change can still break inbound SSH/VPN access while the script reports success.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
88% confidence
Finding

The script restores arbitrary backup files to paths read from sidecar metadata and performs the copy with sudo. Because the backup directory is under /tmp, a writable and commonly shared location, local tampering with backup contents or .path metadata could turn rollback into a privileged arbitrary file overwrite, potentially leading to system compromise or denial of service.

Content

Scanner excerpt · scripts/canary-test.sh (reported line 150)May include surrounding context.

sh
for f in "$BACKUP_DIR"/*; do
                ORIGINAL=$(cat "$f.path" 2>/dev/null || echo "")
                if [ -n "$ORIGINAL" ] && [ -f "$f" ]; then
                    sudo cp "$f" "$ORIGINAL"
                    echo "  ✅ Restored: $ORIGINAL"
                fi
            done

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Rollback copies files into privileged system locations via sudo without a confirmation prompt, dry-run, destination validation, or explicit warning about overwriting active configs. In a recovery script for critical systems, this increases the chance of accidental destructive changes or restoration of stale/untrusted content.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.