Back to skill

Security audit

GOG Dormant Game Cleanup

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly transparent about scanning GOG games and creating email/reminder nudges, but it has default account side effects and an unsafe temporary report file that should be reviewed before use.

Review this before installing. Use DRY_RUN=1 first, confirm the email account and reminders list, avoid scheduled runs until you trust the behavior, and prefer a version that uses a secure per-run temporary file instead of /tmp/gog_dormant_email.txt.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/gog_dormant_cleanup.sh:47
Finding
Predictable Temporary File Enables Local File Clobbering and Information Disclosure## Vulnerability Details **File Location**: `scripts/gog_dormant_cleanup.sh`, lines 47–65 **Vulnerability Type**: Unsafe predictable temporary file **Risk Level**: Medium ### Vulnerable Code ```bash { echo "$subject" echo "" echo "The following installed GOG games have not been played in the last ${CUTOFF_DAYS} days." echo "Consider uninstalling to free up disk space." echo "" printf "%-40s %-22s %s\n" "GAME" "LAST PLAYED" "INSTALL PATH" printf '%.0s-' {1..100}; echo echo "$dormant" | while IFS=$'\t' read -r name last path; do printf "%-40s %-22s %s\n" "$name" "$last" "$path" done echo "" echo "Generated by gog-dormant-cleanup on $(date -Iseconds)" } > /tmp/gog_dormant_email.txt body=$(cat /tmp/gog_dormant_email.txt) ``` The same persistent path is also disclosed at line 87: ```bash echo "himalaya not found; email not sent. Body saved to /tmp/gog_dormant_email.txt" ``` ### Technical Analysis The script writes its report to the fixed, predictable path `/tmp/gog_dormant_email.txt`. It does not use `mktemp`, perform exclusive file creation, verify that the destination is a regular file owned by the current user, establish restrictive permissions, or remove the file after processing. On systems where `/tmp` is shared, an unprivileged local attacker can pre-create this path as a symbolic link. Shell output redirection follows symbolic links, so running the script can truncate and replace the contents of another file writable by the victim. The exact target and consequences depend on the invoking user's permissions. The generated report contains game names, last-played timestamps, and local installation paths. Because the file remains after execution and its permissions depend on the process umask and operating-system defaults, it may also expose local filesystem information. Concurrent executions use the same path and can overwrite or read each other's reports. ### Attack ...[truncated 1470 chars]
Remediation
## Remediation Suggestions Replace the fixed path with a securely created per-run temporary file, restrict permissions before creation, and ensure cleanup on every exit path: ```bash umask 077 tmp_email=$(mktemp "${TMPDIR:-/tmp}/gog_dormant_email.XXXXXX") || { echo "Failed to create temporary report file" >&2 exit 1 } trap 'rm -f -- "$tmp_email"' EXIT { echo "$subject" echo "" echo "The following installed GOG games have not been played in the last ${CUTOFF_DAYS} days." echo "Consider uninstalling to free up disk space." echo "" printf "%-40s %-22s %s\n" "GAME" "LAST PLAYED" "INSTALL PATH" printf '%.0s-' {1..100} echo while IFS=$'\t' read -r name last path; do printf "%-40s %-22s %s\n" "$name" "$last" "$path" done <<< "$dormant" echo "" echo "Generated by gog-dormant-cleanup on $(date -Iseconds)" } > "$tmp_email" body=$(cat -- "$tmp_email") ``` Additional hardening measures: 1. Keep the report entirely in memory when a temporary file is unnecessary. 2. If the report must remain available after an email failure, save it in a private user-owned directory rather than shared `/tmp`. 3. Do not print a stale fixed pathname in status messages; print the securely generated path only when intentional retention is required. 4. Retain `umask 077` or explicitly apply mode `0600` to files containing local paths or activity information. 5. Use a cleanup trap covering normal completion, errors, and signals. 6. Avoid privileged execution unless explicitly required, as the damage possible through file-clobbering defects is bounded by the invoking account's permissions.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Vague Triggers

Medium
Confidence
91% confidence
Finding
The trigger phrases are broad enough to match ordinary requests like 'unplayed games' or 'clean up my library', which can cause the skill to activate when the user did not clearly intend to send email or create reminders. In this skill, that ambiguity is more dangerous because activation leads to side effects on the user's behalf, increasing the risk of unintended automation.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The workflow description states that the skill will email a summary and create Apple Reminders, but it does not present these as prominent user-facing warnings at invocation time. Because the skill performs external actions affecting the user's accounts and productivity tools, insufficient disclosure can lead to unauthorized or surprising actions if the skill is invoked accidentally or by ambiguous phrasing.

Static analysis

No suspicious patterns detected.