Back to skill

Security audit

deployment-kit

Security checks for vulnerabilities and agentic risk

Overview

This is a transparent deployment helper, but it gives broad restart and background-process authority with weak service-name and local-file controls.

Review and edit the scripts before installation. Use fixed service names or an allowlist, avoid broad pkill patterns, prefer systemd-managed services over nohup for production, move heartbeat and log files out of /tmp where possible, and replace source of the Telegram env file with strict variable parsing and restrictive file permissions.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The script builds a heartbeat path directly from the user-controlled service name and reads it from /tmp, a world-writable directory. An attacker who can influence the service argument or place files/symlinks in /tmp may spoof heartbeat state or force unnecessary restarts/alerts, especially because the script immediately invokes deploy.sh when the file is missing or stale.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
if [ "$DRY" = "1" ]; then echo "  [dry-run] no changes made"; exit 0; fi
  read -r -p "  Restart systemd service '$SVC'? [y/N] " ans
  [ "$ans" = "y" ] || [ "$ans" = "Y" ] || { echo "  cancelled"; exit 1; }
  sudo systemctl restart "$SVC" && echo "  systemd: restarted"
else
  echo "  target: kill matching processes (pkill -f '$SVC') + relaunch via nohup"
  if [ "$DRY" = "1" ]; then echo "  [dry-run] no changes made"; exit 0; fi
Confidence
84% confidence
Finding
The script executes sudo systemctl restart using a service name fully controlled by the caller. Although the argument is quoted, this still allows an operator or upstream automation to trigger privileged restarts of arbitrary units if sudoers permits it, making misuse or accidental disruption more dangerous in a deployment skill that changes runtime state.

Credential Access

High
Category
Privilege Escalation
Content
#    Never commit the token in git/logs/shell history.
TOKEN="${TG_BOT_TOKEN:-}"
CHAT="${TG_CHAT_ID:-}"
[ -z "$TOKEN" ] && [ -f ~/.config/tg-alert.env ] && source ~/.config/tg-alert.env
[ -z "$TOKEN" ] && { echo "Set TG_BOT_TOKEN"; exit 1; }
MSG="${1:-⚠️ Alert}"
curl -s --max-time 10 "https://api.telegram.org/bot$TOKEN/sendMessage" \
Confidence
79% confidence
Finding
Using source on a local config file turns a credential file into executable code. In a deployment kit that may run under automation, cron, or elevated service contexts, this increases the risk that a tampered config file leads to command execution or secret misuse.

Credential Access

High
Category
Privilege Escalation
Content
#    Never commit the token in git/logs/shell history.
TOKEN="${TG_BOT_TOKEN:-}"
CHAT="${TG_CHAT_ID:-}"
[ -z "$TOKEN" ] && [ -f ~/.config/tg-alert.env ] && source ~/.config/tg-alert.env
[ -z "$TOKEN" ] && { echo "Set TG_BOT_TOKEN"; exit 1; }
MSG="${1:-⚠️ Alert}"
curl -s --max-time 10 "https://api.telegram.org/bot$TOKEN/sendMessage" \
Confidence
79% confidence
Finding
Using source on a local config file turns a credential file into executable code. In a deployment kit that may run under automation, cron, or elevated service contexts, this increases the risk that a tampered config file leads to command execution or secret misuse.

Session Persistence

Medium
Category
Rogue Agent
Content
read -r -p "  Kill processes matching '$SVC' and relaunch? [y/N] " ans
  [ "$ans" = "y" ] || [ "$ans" = "Y" ] || { echo "  cancelled"; exit 1; }
  pkill -f "$SVC" 2>/dev/null; sleep 2
  # Intentional daemonization: nohup keeps the process running after shell exit
  nohup python3 "$DIR/server.py" >/tmp/$SVC.log 2>&1 &
  echo "  nohup: restarted (pid $!)"
fi
Confidence
89% confidence
Finding
Launching a process with nohup and backgrounding it creates a persistent unmanaged service outside systemd supervision. In this skill context, that is riskier because it can leave long-lived processes running with poor visibility, bypass normal service controls, and make incident response or rollback harder after a bad deploy.

Static analysis

No suspicious patterns detected.