Back to skill

Security audit

Smart Backup

Security checks for vulnerabilities and agentic risk

Overview

This is a local backup tool, but it has unsafe path handling and misleading behavior that can read, write, or restore files outside the locations a user intended.

Install only with review. Use this skill on non-sensitive test directories first, avoid restoring backups from untrusted sources, avoid --force and --delete unless you have inspected the paths, and do not rely on the advertised compression, destination selection, symlink safety, or full SHA-256 integrity claims until the implementation is fixed.

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 (6)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
smart-backup.js:355
Finding

Restore Path Traversal Through Untrusted Manifest Entries

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
smart-backup.js:308
Finding

Backup Verification Can Read Files Outside the Backup Directory

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
smart-backup.js:66
Finding

Backup and Sync Operations Follow Symbolic Links Outside Intended Roots

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
smart-backup.js:23
Finding

User-Supplied Backup Destination and Directory Override Are Ignored

Content
View full analysis
{ if (process.env.BACKUP_DIR) return process.env.BACKUP_DIR; let dir = __dirname; for (let i = 0; i < 10; i++) { if (fs.existsSync(path.join(dir, 'MEMORY.md'))) return dir; dir = path.resolve(dir, '..'); } return path.resolve(__dirname, '..', '..'); })(); const BACKUP_DIR = path.join(WORKSPACE, 'backups', 'smart-backups'); ``` ```javascript function createBackup(source, destination, dryRun = false) { const sourceFiles = collectFiles(source); const timestamp = getToday() + '-' + Date.now(); const backupName = `backup-${timestamp}`; const backupPath = path.join(BACKUP_DIR, backupName); ``` ```javascript for (let i = 0; i < args.length; i++) { // ... if (args[i] === '--dir' && i + 1 < args.length) process.env.BACKUP_DIR = args[i + 1]; } ``` ### Technical Analysis Although `createBackup()` and `createIncrementalBackup()` accept a `destination` argument, both construct the actual backup path from the global `BACKUP_DIR`. The supplied destination is never used. The `--dir` option mutates `process.env.BACKUP_DIR` only after `WORKSPACE` and `BACKUP_DIR` have already been initialized. It therefore does not change the effective backup location in the current process. Users may consequently believe data is being copied to protected or isolated storage while it is actually retained under a workspace-derived directory. ### Attack Path 1. A user selects a restricted or encrypted destination for sensitive backup data. 2. The backup function ignores that destination. 3. The implementation writes the backup below the workspace-derived `backups/smart-backups` path. 4. Other users, processes, or workspace tooling with access to that directory may access the unexpected copy. ...[truncated 251 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
smart-backup.js:472
Finding

Incorrect Positional Argument Parsing Causes Unintended Filesystem Scope

Content
View full analysis
'); } else { if (incremental) { createIncrementalBackup(source, dest, fromManifest, searchQuery === 'dryrun'); } else { createBackup(source, dest, searchQuery === 'dryrun'); } } break; } case 'sync': { const source = args[2]; const dest = args[3]; if (!source || !dest) { console.log('Usage: smart-backup.js --sync '); } else { syncFiles(source, dest, searchQuery === 'dryrun', deleteFlag, forceFlag); } break; } case 'verify': { verifyBackup(args[2]); break; } case 'dedup': { const dups = findDuplicates(args[2] || WORKSPACE); console.log(`[smart-backup] Found ${dups.length} groups of duplicate files:\n`); for (const d of dups.slice(0, 5)) { console.log(` ${d.files.length} files (${formatBytes(d.size)}) — ${d.hash}`); for (const f of d.files) console.log(` → ${f.path}`); } break; } // ... case 'restore': { const backup = args[2]; const dest = args[3]; if (!backup || !dest) { console.log('Usage: smart-backup.js --restore '); } else { restoreBackup(backup, dest, forceFlag); } break; } } ``` ### Technical Analysis For a documented command such as `--dedup /chosen/path`, the option is at `args[0]` and its operand is at `args[1]`. The implementation instead reads `args[2]`. As a result: - `--dedup ` ignores the supplied directory and falls back to `WORKSPACE`. - Normal backup, sync, and restore forms misassign or lose operands. - Verification receiv ...[truncated 943 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
smart-backup.js:57
Finding

SHA-256 Integrity Digests Are Truncated to 64 Bits

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documentation materially misstates behavior: it advertises compression that is not implemented, suggests user-specified destinations that may actually be ignored, and underdeclares persistent state plus destructive delete/overwrite modes. In backup/restore tooling, this mismatch is dangerous because users and agents may make safety decisions based on false assumptions, leading to data loss, privacy exposure, or writes outside intended locations.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · smart-backup.js (reported line 471)May include surrounding context.

js
let incremental = false;
let fromManifest = null;
let deleteFlag = false;    // --delete: enable file deletion during sync
let forceFlag = false;      // --force: overwrite existing files (restore) or proceed with deletion (sync)

for (let i = 0; i < args.length; i++) {
  if (args[i] === '--backup') mode = 'backup';

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The markdown lists commands for backup, sync, and restore that act on user files and directories, but it does not warn that these operations can write data to destinations and potentially overwrite existing contents. For markdown files, safety-relevant behavior affecting user data should be disclosed so users understand the risk before invoking the skill.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The skill declares no explicit tool scope or permissions while the analyzer detected environment-related capabilities. In an agent setting, missing scope declarations can cause the skill to be invoked with broader-than-expected authority, reducing operator visibility into what resources it may access.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest description and module header describe 'compression' as part of the skill, but the implemented backup paths simply copy files with fs.copyFileSync and even note 'in production, would compress'. This is a direct mismatch between the advertised behavior and the actual code behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The description lists very general capabilities like 'Backup, sync, verify integrity, dedup, and restore' without narrowing when this skill should be selected versus ordinary conversational mentions of backing up or restoring files. In a manifest-context file, this lack of trigger specificity can cause unintended invocation overlap with common file-management requests.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The section encourages adding the skill to heartbeat/maintenance workflows with recurring actions, but it does not clearly define when the skill should or should not run, or what safeguards determine applicability. For manifest/markdown guidance, this can make invocation scope too broad in automated maintenance contexts.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The comment explicitly frames the following block as a placeholder for compression, but the code beneath it performs uncompressed file copies only. Because the skill documentation presents compression as a current capability, this comment highlights an intent-code divergence rather than a mere omitted detail.

Content

No source excerpt is available for this finding.