Back to skill

Security audit

WorkBuddy 数据目录迁移(junction)

Security checks for vulnerabilities and agentic risk

Overview

The skill has a legitimate migration purpose, but its scripts can permanently move and delete WorkBuddy data with unsafe defaults that deserve manual review before use.

Review this skill carefully before installing or running it. Only use it after backing up the full WorkBuddy directory, closing WorkBuddy, confirming the exact target drive and destination path, and ensuring no important data already exists at the chosen workbuddy-data path. The issues look like unsafe migration engineering rather than malware, but a failed or misdirected run could cause data loss or expose your WorkBuddy profile on the wrong volume.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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 (4)

T07 · Tool Hijacking and Spoofing

Error
Location
scripts/migrate.bat:13
Finding

Predictable staging directory permits local executable substitution

Content
View full analysis
nul if not exist "C:\migrate_tmp\node.exe" ( echo FAILED to stage node.exe - aborting. pause exit /b 1 ) C:\migrate_tmp\node.exe "%~dp0migrate.js" set RC=%errorlevel% C:\Windows\System32\cmd.exe /c rmdir /s /q C:\migrate_tmp >nul 2>&1 ``` ### Technical Analysis The launcher stages and executes `node.exe` from the fixed, globally predictable path `C:\migrate_tmp`. It does not securely create this directory, restrict its permissions, verify that it owns the directory, validate the `robocopy` exit status, or compare the staged executable with the trusted source. The only validation is an existence check. If a local attacker pre-creates `C:\migrate_tmp\node.exe` and prevents `robocopy` from replacing it—for example, through directory permissions, file permissions, or a lock—the existence test still succeeds. The launcher then executes the attacker-controlled binary. Because the script invokes the staged executable directly, this is a tool-spoofing vulnerability rather than ordinary command-line injection. ### Attack Path 1. A local attacker creates `C:\migrate_tmp`. 2. The attacker places a malicious executable at `C:\migrate_tmp\node.exe`. 3. The attacker configures permissions or locks so that the legitimate `node.exe` cannot replace the malicious file. 4. The victim starts `scripts/migrate.bat`. 5. `robocopy` fails to replace the planted executable, but its result is not checked. 6. `if not exist` succeeds because the malicious file exists. 7. The batch file executes the malicious `node.exe` with the victim's privileges. ### Impact Assessment Successful exploitation provides arbitrary code execution with the privi ...[truncated 334 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/migrate.js:109
Finding

Existing destination data is recursively deleted without destination-specific confirmation

Content
View full analysis
DST (node fs.cpSync; 2-5 min; window may look frozen - do NOT close)'); try { if (exists(DST)) { fs.rmSync(DST, { recursive: true, force: true }); log(' removed stale DST'); } fs.cpSync(SRC, DST, { recursive: true, force: true, verbatimSymlinks: true }); log('[2/4] copy done'); } catch (e) { ``` The only launcher confirmation is generic and does not identify the selected destination or disclose that an existing destination will be erased: ```bat echo Close WorkBuddy fully (tray icon too), then press any key to start. pause ``` This also conflicts with the documented workflow in `SKILL.md:25-28`, which requires explicit confirmation before deleting anything. ### Technical Analysis The destination is always the fixed root-level path `:\workbuddy-data`. If that path already exists, the implementation assumes it is stale and recursively deletes it with `force: true`. The script does not establish that the existing directory was created by a previous run, that it contains only disposable data, or that it belongs to the current WorkBuddy profile. It also does not present the resolved destination before the operation or obtain destination-specific consent. The deletion can therefore destroy an earlier valid migration, a backup, or unrelated user data stored at the same path. ### Attack Path 1. A selected drive already contains a non-empty `workbuddy-data` directory. 2. The directory contains a previous valid migration, a backup, or unrelated files. 3. The user launches the migration and accepts the generic “press any key” prompt. 4. The script automatically selects the drive without displaying a deletion confirmation for the resolved path. 5. `fs.rmSync` recursively and forcibly deletes the entire existing destinat ...[truncated 572 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/migrate.js:17
Finding

Automatic target selection does not verify that the volume is a fixed local disk

Content
View full analysis
bestFree) { bestFree = free; best = d; } } catch (e) {} } return best; } ``` ### Technical Analysis Although the comment and skill documentation claim that the script selects a fixed non-system disk, the implementation only tests whether a drive letter responds to `statfsSync` and reports more free space than the other candidates. It does not query the Windows drive type or reject mapped network drives, removable media, virtual filesystems, or other unsuitable volumes. Consequently, any accessible drive letter from `D:` through `Z:` can be selected if it reports the greatest amount of free space. The migration copies the complete WorkBuddy profile to that volume and replaces the original profile with a junction to it, making continued application availability dependent on the selected volume. ### Attack Path 1. A removable, mapped network, virtual, or externally administered volume is assigned a drive letter between `D:` and `Z:`. 2. That volume reports more available space than the local fixed disks. 3. The migration runs and automatically selects that volume. 4. The script copies the complete WorkBuddy profile to `:\workbuddy-data`. 5. The original profile path is replaced with a junction to the unsuitable volume. 6. A remote administrator, device removal, network outage, or reassignment of the drive letter can expose, modify, or make the profile unavailable. ### Impact Assessment The full WorkBuddy profile—including conversation history, sessio ...[truncated 404 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/migrate.js:120
Finding

Copy verification checks only a small hard-coded subset before deleting the source copy

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · SKILL.md (reported line 27)May include surrounding context.

md
## Workflow

1. **Inventory (read-only).** Measure size of `C:\Users\USER\.workbuddy`, AppData leftovers (`pip\cache`, `@genieworkbuddy-desktop-updater\installer.exe`), and free space on every disk. Present a cleanup + migration plan and get **explicit confirmation before deleting anything**.
2. **Cleanup (optional, only after confirmation).** Remove stale, safe-to-delete caches: pip cache, the leftover installer.exe, old traces/logs, Electron session cache. **Never** delete conversation history (`projects/`, `sessions/`, `blobs/`, `workbuddy.db`).
3. **Migration.** Use the bundled `scripts/migrate.bat` (double-click). It stages node to a neutral temp, runs `scripts/migrate.js` which: copies data to E:, **verifies the copy is complete**, renames the C: dir, creates the junction, self-checks, then reclaims C: space.
4. **Verify.** Confirm `C:\Users\USER\.workbuddy` is a junction (`isSymbolicLink`) resolving to `E:\workbuddy-data`, node is still reachable via the C: path, `workbuddy.db` is valid, and C: free space increased.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest advertises automatic migration of a user data directory via a Windows junction and explicitly says it requires no administrator permission, but it does not warn about filesystem redirection, backup/tooling side effects, rollback steps, or the risk of moving active application data. This can mislead users into making persistent system-level changes that may cause data loss, broken application behavior, or confusion about where sensitive data is stored.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The manifest description is entirely in Chinese, while the triggers mix Chinese and English, suggesting the skill may be presented in a fixed language without user opt-in. There is no stated justification that this is a region-specific or Chinese-only skill, nor any indication that users can choose their preferred language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This batch script copies node.exe into C:\migrate_tmp and later removes that directory with a recursive quiet delete. Although the script generally states it performs a migration, it does not explicitly warn the user that it will create and silently delete a temporary folder on the system drive, and there is no user-facing log message around those operations.

Content

No source excerpt is available for this finding.