T09 · Insecure Skill Coding Practices
- Location
scripts/setup.sh:100- Finding
Arbitrary Command Execution and rclone Option Injection Through Unsafe Configuration Handling
- Content
View full analysis
"$ENV_FILE" <- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill's notes-sync purpose is clear, but it needs review because its shell configuration handling can turn crafted setup/config values into commands during sync.
Review before installing. This skill can change or delete notes on both local and remote storage and stores R2/rclone secrets locally. The main issue to fix is replacing sourced .env shell config with safely parsed data, validating setup inputs, and removing or allowlisting extra rclone flags. Use status and dry-run first, and keep an independent backup of the vault.
scripts/setup.sh:100Arbitrary Command Execution and rclone Option Injection Through Unsafe Configuration Handling
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env bash
# Interactive configuration wizard for the sync-notes skill.
# Writes config/rclone.conf and config/.env (chmod 600).
set -euo pipefail
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env bash
# Interactive configuration wizard for the sync-notes skill.
# Writes config/rclone.conf and config/.env (chmod 600).
set -euo pipefail
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env bash
# Interactive configuration wizard for the sync-notes skill.
# Writes config/rclone.conf and config/.env (chmod 600).
set -euo pipefail
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env bash
# Interactive configuration wizard for the sync-notes skill.
# Writes config/rclone.conf and config/.env (chmod 600).
set -euo pipefail
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/usr/bin/env bash
# Interactive configuration wizard for the sync-notes skill.
# Writes config/rclone.conf and config/.env (chmod 600).
set -euo pipefail
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
SKILL_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
CONFIG_DIR="$SKILL_DIR/config"
RCLONE_CONFIG_FILE="$CONFIG_DIR/rclone.conf"
ENV_FILE="$CONFIG_DIR/.env"
command -v rclone >/dev/null 2>&1 || { echo "rclone is required" >&2; exit 1; }
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
SKILL_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
CONFIG_DIR="$SKILL_DIR/config"
RCLONE_CONFIG_FILE="$CONFIG_DIR/rclone.conf"
ENV_FILE="$CONFIG_DIR/.env"
command -v rclone >/dev/null 2>&1 || { echo "rclone is required" >&2; exit 1; }
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
clean_failed_baseline() {
# Wipe partial bisync state so --resync can start clean.
rm -f "$BISYNC_WORKDIR"/*.lst-new "$BISYNC_WORKDIR"/*.lst-err 2>/dev/null || true
}
scan_conflicts() {
The skill explicitly orchestrates shell execution via bash/rclone but declares no tool scope restrictions such as allowed tools or permissions. In an agent environment, this broadens the execution surface and can allow unintended shell access or make policy enforcement ambiguous, especially for a skill that performs filesystem and remote sync operations.
The user-facing description does not prominently warn that bidirectional sync and copy operations can overwrite files or propagate deletions/conflicts between local and remote storage. This creates a real safety risk of unintended data loss because users may trigger destructive synchronization without informed consent.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
#!/usr/bin/env bash
# Interactive configuration wizard for the sync-notes skill.
# Writes config/rclone.conf and config/.env (chmod 600).
set -euo pipefail
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
#!/usr/bin/env bash
# Interactive configuration wizard for the sync-notes skill.
# Writes config/rclone.conf and config/.env (chmod 600).
set -euo pipefail
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
#!/usr/bin/env bash
# Interactive configuration wizard for the sync-notes skill.
# Writes config/rclone.conf and config/.env (chmod 600).
set -euo pipefail
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
#!/usr/bin/env bash
# Interactive configuration wizard for the sync-notes skill.
# Writes config/rclone.conf and config/.env (chmod 600).
set -euo pipefail
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
#!/usr/bin/env bash
# Interactive configuration wizard for the sync-notes skill.
# Writes config/rclone.conf and config/.env (chmod 600).
set -euo pipefail
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
#!/usr/bin/env bash
# Interactive configuration wizard for the sync-notes skill.
# Writes config/rclone.conf and config/.env (chmod 600).
set -euo pipefail
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
#!/usr/bin/env bash
# Interactive configuration wizard for the sync-notes skill.
# Writes config/rclone.conf and config/.env (chmod 600).
set -euo pipefail
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
#!/usr/bin/env bash
# Interactive configuration wizard for the sync-notes skill.
# Writes config/rclone.conf and config/.env (chmod 600).
set -euo pipefail
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
#!/usr/bin/env bash
# Interactive configuration wizard for the sync-notes skill.
# Writes config/rclone.conf and config/.env (chmod 600).
set -euo pipefail
The trigger examples and parsing rules embed Chinese-specific commands such as 下载, 拉, 上传, and 试, which indicates locale-specific behavior. The file does not explicitly state that multiple languages are supported by choice or that Chinese parsing is optional, so it risks imposing undocumented language handling policy.