T09 · Insecure Skill Coding Practices
- Location
scripts/force-unlock.sh:81- Finding
Arbitrary JavaScript Execution Through Unsafe Note Interpolation in Force-Unlock Helper
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a task workflow helper, but several bundled scripts can modify task state and can be abused to run local code or touch files outside the task folder.
Review before installing. Use this only in a restricted workspace with limited filesystem access, and avoid running unblock or force-unlock helpers with untrusted task IDs or note text until they validate IDs, stop constructing node -e programs from user input, and constrain reference_files to approved project paths. I did not find evidence of credential theft, remote payload execution, or install-time persistence.
scripts/force-unlock.sh:81Arbitrary JavaScript Execution Through Unsafe Note Interpolation in Force-Unlock Helper
scripts/unblock-task.sh:106Arbitrary JavaScript Execution Through Unsafe Note Interpolation in Unblock Helper
scripts/atomic-lock.sh:25Unvalidated Task Identifiers Permit Filesystem Path Traversal and Unsafe Recursive Deletion
scripts/trigger-review.js:93Untrusted Task Content Can Hijack the Generated Reviewer Prompt and Request Unrestricted File Reads
The skill references scripts that can remove lock directories and mutate task state, including unblocking work for later pickup, while the description frames the package as a safe supervised utility. In practice, filesystem deletion and workflow reactivation are sensitive control actions; if misunderstood or over-permitted, they can bypass operational safeguards and interfere with task lifecycle integrity.
The skill references scripts that can remove lock directories and mutate task state, including unblocking work for later pickup, while the description frames the package as a safe supervised utility. In practice, filesystem deletion and workflow reactivation are sensitive control actions; if misunderstood or over-permitted, they can bypass operational safeguards and interfere with task lifecycle integrity.
The skill references scripts that can remove lock directories and mutate task state, including unblocking work for later pickup, while the description frames the package as a safe supervised utility. In practice, filesystem deletion and workflow reactivation are sensitive control actions; if misunderstood or over-permitted, they can bypass operational safeguards and interfere with task lifecycle integrity.
The skill references scripts that can remove lock directories and mutate task state, including unblocking work for later pickup, while the description frames the package as a safe supervised utility. In practice, filesystem deletion and workflow reactivation are sensitive control actions; if misunderstood or over-permitted, they can bypass operational safeguards and interfere with task lifecycle integrity.
The skill references scripts that can remove lock directories and mutate task state, including unblocking work for later pickup, while the description frames the package as a safe supervised utility. In practice, filesystem deletion and workflow reactivation are sensitive control actions; if misunderstood or over-permitted, they can bypass operational safeguards and interfere with task lifecycle integrity.
Referenced artifact was not completely inspected
- `scripts/activate-queued-tasks.js` to move ready tasks from `queued` to `pending`
Referenced artifact was not completely inspected
- `scripts/activate-queued-tasks.js` to move ready tasks from `queued` to `pending`
Referenced artifact was not completely inspected
- `scripts/trigger-review.js` to generate a review prompt for supervised review
Referenced artifact was not completely inspected
- `scripts/trigger-review.js` to generate a review prompt for supervised review
Referenced artifact was not completely inspected
- `scripts/apply-review.js` to write a review result back into a task JSON file
Referenced artifact was not completely inspected
- `scripts/apply-review.js` to write a review result back into a task JSON file
The script resets a task to pending and explicitly states that a main-agent heartbeat will automatically detect that state and continue review, which re-enables autonomous workflow progression. That behavior materially conflicts with the skill description claiming it avoids autonomous background execution, increasing the risk of unintended task advancement after a manual unlock operation.
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
{ pattern: /rm\s+-rf\s+\/\s*$/, reason: '删除根目录' },
{ pattern: /rm\s+-rf\s+~\s*$/, reason: '删除用户主目录' },
{ pattern: /rm\s+-rf\s+\/\*/, reason: '删除所有根目录文件' },
{ pattern: /curl\s+[^|]+\|\s*(ba)?sh/, reason: '远程代码执行(curl | sh)' },
{ pattern: /wget\s+[^|]+\|\s*(ba)?sh/, reason: '远程代码执行(wget | sh)' },
{ pattern: /chmod\s+777/, reason: '设置全权限(chmod 777)' },
{ pattern: /\bsudo\b/, reason: '提权操作(sudo)' },
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
{ pattern: /rm\s+-rf\s+~\s*$/, reason: '删除用户主目录' },
{ pattern: /rm\s+-rf\s+\/\*/, reason: '删除所有根目录文件' },
{ pattern: /curl\s+[^|]+\|\s*(ba)?sh/, reason: '远程代码执行(curl | sh)' },
{ pattern: /wget\s+[^|]+\|\s*(ba)?sh/, reason: '远程代码执行(wget | sh)' },
{ pattern: /chmod\s+777/, reason: '设置全权限(chmod 777)' },
{ pattern: /\bsudo\b/, reason: '提权操作(sudo)' },
{ pattern: /dd\s+if=\/dev\/zero/, reason: '磁盘写入操作' },
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).
{ pattern: /rm\s+-rf\s+\/\*/, reason: '删除所有根目录文件' },
{ pattern: /curl\s+[^|]+\|\s*(ba)?sh/, reason: '远程代码执行(curl | sh)' },
{ pattern: /wget\s+[^|]+\|\s*(ba)?sh/, reason: '远程代码执行(wget | sh)' },
{ pattern: /chmod\s+777/, reason: '设置全权限(chmod 777)' },
{ pattern: /\bsudo\b/, reason: '提权操作(sudo)' },
{ pattern: /dd\s+if=\/dev\/zero/, reason: '磁盘写入操作' },
{ pattern: /:\(\)\s*\{\s*:\|:&\s*\}\s*;/, reason: 'Fork Bomb' },
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).
console.log('用法:');
console.log(' node security-scan.js <task-file.json> # 扫描任务文件');
console.log(' node security-scan.js --stdin # 从 stdin 读取指令');
console.log(' echo "rm -rf /" | node security-scan.js --stdin');
console.log('');
console.log('退出码:');
console.log(' 0 - 安全,无危险命令');
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).
console.log('用法:');
console.log(' node security-scan.js <task-file.json> # 扫描任务文件');
console.log(' node security-scan.js --stdin # 从 stdin 读取指令');
console.log(' echo "rm -rf /" | node security-scan.js --stdin');
console.log('');
console.log('退出码:');
console.log(' 0 - 安全,无危险命令');
The skill advertises shell-capable helper scripts but does not declare any explicit tool scope such as allowed-tools or permissions. That creates a policy gap where a host agent may over-grant shell access or invoke the skill without clear restrictions, increasing the chance of unintended filesystem or process actions.
This JSON config contains multiple natural-language descriptions only in Chinese, including role behavior and executor defaults. Because the file provides no opt-in, alternative locale, or justification for a Chinese-only policy, it may impose a language preference on users or operators in violation of the language/locale policy requirement.
The file's natural-language descriptions and CLI output are presented in Chinese throughout, which imposes a specific language on users. The file does not offer an opt-in language choice or explain that the tool is intentionally limited to a Chinese-speaking context.
This code performs a direct file write to the task JSON using fs.writeFileSync, which changes persistent task state. Although the script logs after applying the review, there is no confirmation prompt or explicit warning near the write path that the existing task file will be modified in place.
The comment on L156 states only the approve/revise path results in a reviewed state awaiting executor-agent execution. However, the reject branch immediately above can also drive further execution by setting the task back to pending on L152-L153, which conflicts with the script's framing of review outcomes and next execution handling.
The script deletes a path derived from untrusted user input using rm -rf without validating that task_id is constrained to an expected safe format. Because lock_dir is built as $TASKS_DIR/${task_id}.lock.d, a crafted task ID containing path traversal sequences (for example ../../...) could cause recursive deletion outside the intended tasks directory if the caller can supply arbitrary IDs.
The manifest describes this package as a safe publishing variant for human-supervised workflows that avoids autonomous background execution. Here the script explicitly classifies tasks into an 'auto' mode and later prepares them for automated reviewer-driven subtask generation, which expands behavior beyond the stated non-autonomous scope.
The comment says status is written back to pending only for blocked or reviewing tasks, but the actual condition also includes executing. This is an intent/documentation mismatch around a sensitive recovery path because it broadens which tasks can be forcibly reverted.
No suspicious patterns detected.