T09 · Insecure Skill Coding Practices
- Location
scripts/dev-backup.sh:211- Finding
Command and Option Injection in the tar Backup Fallback
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This backup skill is mostly purpose-aligned, but its restore and tar fallback behavior create real local file-safety and command-execution risks.
Install only if you understand it will read and write whole project directories. Use it on trusted project paths, ensure rsync is available, avoid restoring snapshots with missing or mismatched checksums, and do not rely on restore to remove files created after a snapshot.
scripts/dev-backup.sh:211Command and Option Injection in the tar Backup Fallback
scripts/dev-backup.sh:142Snapshot Integrity Verification Fails Open During Restore
When rsync is unavailable, the fallback tar path archives the entire project directory without applying the documented exclusions for .git, node_modules, .env, logs, caches, or backups. This can capture sensitive secrets, large dependency trees, and nested backup content, increasing the chance of credential exposure, excessive storage use, and unintended propagation of confidential or hazardous files into snapshots.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if command -v rsync &>/dev/null; then
rsync -a \
--exclude '.git' --exclude 'node_modules' --exclude '.vite' \
--exclude '.cache' --exclude '*.log' --exclude '.env' \
--exclude 'backups' \
"${PROJECT_DIR}/" "${SNAPSHOT_DIR}/"
else
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
if command -v rsync &>/dev/null; then
rsync -a \
--exclude '.git' --exclude 'node_modules' --exclude '.vite' \
--exclude '.cache' --exclude '*.log' --exclude '.env' \
--exclude 'backups' \
"${PROJECT_DIR}/" "${SNAPSHOT_DIR}/"
else
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
else
# Fallback: tar with explicit exclusions matching rsync defaults
EXCLUDES=""
for excl in .git node_modules .vite .cache '*.log' .env backups; do
EXCLUDES="$EXCLUDES --exclude $excl"
done
tar -C "$(dirname "$PROJECT_DIR")" -cf - \
This file contains user-facing operational and safety instructions only in Italian, which effectively forces a specific language for using the skill. The policy allows locale constraints only when users are given a choice or when the restriction is clearly documented and justified, neither of which appears here.
This markdown file contains key activation rules and safety instructions only in Italian, while other parts of the document are in English. That creates a locale policy issue because the skill effectively imposes a specific language for critical behavior and warnings without user opt-in or an explicit language choice.
The restore documentation promises destructive synchronization semantics ('newer files will be deleted'), but the implementation only copies snapshot contents back with rsync -a or cp -a and never removes files that exist only in the target. This mismatch is dangerous because operators may rely on the documented rollback behavior for safety or incident recovery and end up with residual files, code, or artifacts that should have been removed.
Natural-language strings in the embedded script use Italian for checksum, warning, dry-run, and destructive-operation messages. Because these are user-facing operational and safety messages, forcing a locale without offering a choice can violate language/locale policy.
This shell script includes multiple user-facing messages and the restore confirmation prompt entirely in Italian, such as checksum status, dry-run guidance, destructive-operation warning, and the required confirmation input. Because the script does not offer any language selection or document a justified locale restriction, it violates the language/locale policy for natural-language content.