Back to skill

Security audit

KPA掌机天马安装与优化助手

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this skill suspicious because it reports command and download risks, actions beyond its stated setup purpose, and meaningful gaps in scan coverage.

Consider the scanner's recommendation not to install this skill unless you are comfortable reviewing its commands and accepting the reported risks. Coverage is incomplete: Skillspector inspected 86 of 91 components, with five partial inspections and several degraded static analyzers, so the scan cannot establish that unreported behavior is safe.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
.
Finding

Game-library content can inject Android shell commands

Content
View full analysis

Impact

Arbitrary device-shell commands can modify or delete files accessible to that identity. For example, the basename x'; id; #.iso passes the extension filter and breaks the intended command quoting. Root or host-side execution is not established.

T08 · Insecure Dependencies

Error
Location
.
Finding

Executable-core installation uses unauthenticated HTTP sources

Content
View full analysis

Impact

A substituted core can execute with RetroArch's application privileges when loaded, accessing or modifying data available to that application.

T09 · Insecure Skill Coding Practices

Warning
Location
.
Finding

Cleanup permanently deletes files outside the selected library without an approval gate

Content
View full analysis

Impact

Unrelated files sharing the ._* prefix and legitimate filesystem metadata can be permanently removed outside the selected library. The configuration backup does not preserve those files.

Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (91)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

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).

Content

Scanner excerpt · INSTALL.md (reported line 122)May include surrounding context.

bash
RUN=~/WorkBuddy/kpa-oneclick/<时间戳>
adb push "$RUN/backup/meta/<平台>.txt" /storage/6AF3-384F/Roms/<平台>/metadata.pegasus.txt
adb shell 'am force-stop org.pegasus_frontend.android; rm -f /sdcard/pegasus-frontend/dataCache.json'

设备侧还有一份同步副本 /sdcard/backup/kpa-oneclick-<时间戳>/。

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · INSTALL.md (reported line 122)May include surrounding context.

bash
RUN=~/WorkBuddy/kpa-oneclick/<时间戳>
adb push "$RUN/backup/meta/<平台>.txt" /storage/6AF3-384F/Roms/<平台>/metadata.pegasus.txt
adb shell 'am force-stop org.pegasus_frontend.android; rm -f /sdcard/pegasus-frontend/dataCache.json'

设备侧还有一份同步副本 /sdcard/backup/kpa-oneclick-<时间戳>/。

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

APK and configuration synchronization reasonably supports the declared installation and troubleshooting purpose. However, step 3 explicitly packages /sdcard/RetroArch/system and pulls it into the skill's assets as kpa_system.tar. The comments and final notice identify this content as BIOS firmware intended for later offline installation. This is a material mismatch with the description's '不含 ROM/BIOS' exclusion. No ROM copying is evident in the supplied chunk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Storage checks can support installation troubleshooting, but this chunk specifically targets host application data and general user directories rather than handheld devices or emulator installations. Its actual purpose is host storage diagnostics, which is not represented by the declared description. The commands do not delete files or obtain ROMs or BIOS files.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

The primary workflow is game removal and launcher deregistration, rather than installation or troubleshooting of the declared frontend and emulators. Backups and Pegasus cache rebuilding are reasonable supporting maintenance operations, but they do not account for the undeclared game-uninstallation capability. The comments acknowledge that game saves may be inaccessible before uninstalling. No ROM or BIOS distribution is shown.

Content

No source excerpt is available for this finding.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
bash scripts/kpa_oneclick.sh --dry-run # 只读体检 + 计划,设备离线也能预览

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
bash scripts/kpa_oneclick.sh # 体检 → 双回滚点 → 7 步幂等 → 清缓存 → 校验 → report.md

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| 直接执行 | `scripts/kpa_oneclick.sh`;只跑 7 步用 `scripts/run_all.sh` |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
核心 / ANDROID 收录 / `.nomedia` / 详情页 / 主题增强 / 五类实机修复 / 健康校验 / 简介回填 / 设备同步)清单与用法见 `references/PLAYBOOK.md` §20 与各脚本头注释。

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
⚠️ 针对特定机器数据的一次性修复 —— 热门 10 款置顶、DOS 同名 `.conf`、GBA 真盒绘回填、土星坏 CHD 删除、CPS1/CPS3 键位、N64 摇杆绑定 —— **不进一键脚本**,按需查 `references/PLAYBOOK.md` §18–§19。

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| 关键技术事实速查(按键 / 竖版 / MSX / 主题 / PPSSPP / 缓存) | `references/PLAYBOOK.md` §21 |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| 分项实操手册(metadata / RA 分层 / 竖版 / 封面 / 详情页 / 清理 / DOS / 按键) | `references/PLAYBOOK.md` |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
## 硬性禁令(Top 10;全文 57 条见 `references/HARD_RULES.md`)

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| 57 条禁令全文与正确做法 | `references/HARD_RULES.md` |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

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).

Content

Scanner excerpt · references/HARD_RULES.md (reported line 26)May include surrounding context.

md
## B. Pegasus 天马

**5. 禁止改 metadata / 新增目录后不清 `dataCache.json` 就判断生效**
- ✅ `rm /sdcard/pegasus-frontend/dataCache.json` → force-stop 重启 `org.pegasus_frontend.android` → 日志 `N games found` 才是准数。缓存会保留已删除游戏(幽灵条目)。

**6. 禁止靠改 `game_dirs.txt` 排除目录**
- 天马启动会重写回原样。

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

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).

Content

Scanner excerpt · references/PLAYBOOK.md (reported line 28)May include surrounding context.

md
- `description:` 支持多行,后续行缩进两空格;留空则主题显示 `No description available`。
- `publisher / developer / release / genre / players` 影响 prosperoOS 详情页「More by 厂商」区块;16 个平台原本缺这些字段。
- per-game `launch:` 覆盖集合级 `launch:`,用于换核心(例:`mercsj / samuraia / sonicwi` 换 `fbneo_libretro_android.so`)或独立 APP(PSP 用 PPSSPP intent)。
- **改完必做**:`rm /sdcard/pegasus-frontend/dataCache.json` → 重启天马。

### ANDROID 移植游戏(关键)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

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).

Content

Scanner excerpt · references/PLAYBOOK.md (reported line 570)May include surrounding context.

md
**验证 SOP(必须从前端点击,逐条)**:

1. 改完 `rm /sdcard/pegasus-frontend/dataCache.json` → `am force-stop org.pegasus_frontend.android` → 重启,等 `N games found`。
2. `am force-stop org.ppsspp.ppsspp` 保证冷启动。天马是 Qt 应用:`input keyevent 21/22` 选游戏、`input keyevent 66`(ENTER)启动有效;**`input tap` / `motionevent` 实测无响应**。
3. `logcat -d -t 1200 | grep -iE 'Shortcut Parameter|Launch shortcut|\[BOOT\] Booted|FileUriExposed'`:冷启动应出现 `NativeApp.init(): Launch shortcut parameter:` + `[BOOT] Booted <iso>`;热切换应出现 `Posting a 'shortcutParam' message`。
4. 截图确认画面;`grep -c "Failed to run the launch command" lastrun.log` 必须为 0。

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

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).

Content

Scanner excerpt · references/PLAYBOOK.md (reported line 860)May include surrounding context.

t=l[5:].strip() if t in idx: out.append('sort-by: %02d %s\n'%(idx[t],t))

text
`EXPLICIT` 给小平台/中文平台精确名单,`SCORE` 给大平台打分,`PENALTY` 降权 hack/改版/汉化/β。产出 35 份 metadata、**334 条** game-level `sort-by`(部分平台不足 10 款),覆盖全部 35 平台。⛔ metadata 只 patch 不整覆盖;改完必须 `am force-stop org.pegasus_frontend.android` → `rm /sdcard/pegasus-frontend/dataCache.json` → 重启天马。

### 18.4 DOS 直启 + 崩溃救援(第 2 项,本轮最大突破)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

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).

Content

Scanner excerpt · references/PROCESS_REVIEW.md (reported line 50)May include surrounding context.

md
- **目标**:解决世嘉「透明遮挡」、PSP 天马直启、prosperoOS 主题、MSX 黑屏、封面/详情页/简介、全平台核心实测。
- **执行动作**:清空 `global_MD/SATURN/DC*.slangp` 与 Gearsystem 滤镜链(crt-easymode 在 960×640 上网点雾感,用户选「无滤镜」);PSP ROM 双份拷入 PPSSPP app 私有目录 + 逐游戏 launch;装 prosperoOS(master 分支)并修补 `assets.logo || assets.boxFront` 回退、封面放大、潜水员戴夫背景;MSX 根因定位为缺 bluemsx 核心(BIOS 齐全);封面坏图三来源修复;详情页 description 字段 + dataCache 缓存机制;生成 3773 条模板中文简介。
- **关键命令 / 路径**:`rm /sdcard/pegasus-frontend/dataCache.json` 后重启;`/storage/emulated/0/Android/data/org.ppsspp.ppsspp/files/PSP/SYSTEM/ppsspp.ini`(`DisplayStretch=True` 带空格、`ShowTouchControls=False`);`/sdcard/pegasus-frontend/themes/prosperoOS/`;`assets/meta_latest/*.txt`。
- **结果**:24 核心逐一实测可加载;ATOMISWAVE「不兼容」被纠正为误判(裸 .bin 可玩,NOTICE 屏 20-30s);prosperoOS 实机验证通过;详情页与中文简介正常显示;模板简介元数据 +380KB。

### 阶段 P4 — KPA Skill 沉淀与上架瘦身(11-12 13:00 → 17:58)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

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).

Content

Scanner excerpt · references/PROCESS_REVIEW.md (reported line 87)May include surrounding context.

md
description:`;`description:` 多行值后续行缩进两空格。支持 publisher / developer / release / genre / players 字段,prosperoOS 详情页「More by 厂商」区块依赖它们。
- **内容源**:libretro-database 的 31 个平台 `.rdb`(msgpack,magic `RARCHDB` + 16B 头)+ metadat CLRMAME dat(`publisher/releaseyear/genre/users` 字段,非 `comment`),命中 2906/3744(77%);街机按 zip 名=romset、家用机按 local header 偏移 14 的 crc32 匹配;后补 3773 条模板中文简介。
- **dataCache.json(定制版 Pegasus alpha16 的元数据缓存)**:直接改 metadata 后重启**不生效**(日志 `Cache loaded successfully`)。**任何 metadata / 新增目录改动后必须 `rm /sdcard/pegasus-frontend/dataCache.json` 再 force-stop 重启 `org.pegasus_frontend.android`**。缓存会保留已删除游戏;游戏总数以清缓存后重建的 `N games found` 为准。
- **game_dirs.txt**:曾 33→36→39→36;**天马启动时会把它重写回原样**(01:56 实测恢复成 1096 字节),改它排除目录无效;根治幽灵条目必须删掉备份目录本身。
- **`.app` 占位 + per-game launch(ANDROID 移植游戏整合)**:Pegasus 需要一个真实存在的文件才会建游戏条目。做法 = `collection: ANDROID` + `extensions: app` + 创建 7 个真实占位文件(如 `tmnt.app`,内容 `android app launcher placeholder`)+ 每游戏 `file: <名>.app` + `launch: am start --user 0 -n <包名>/<Activity>` +

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

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).

Content

Scanner excerpt · references/PROCESS_REVIEW.md (reported line 312)May include surrounding context.

md
4. **禁止 `input tap` / 大部分 `input keyevent` 操作 RA ozone 菜单**(固件走内核 evdev 直读);只有 `input motionevent DOWN/UP`、BACK(4)、方向键 21/22/19/20 有效。
5. **禁止手工在核心 cfg 写 `video_shader` 键** —— 破坏 RA 自动预设加载链;改 `global_*.slangp` 一处即可覆盖上百逐游戏预设。
6. **禁止整份覆盖 `metadata.pegasus.txt`** —— 云端与设备 ROM 数不匹配会丢游戏;只就地 patch 启动命令/字段。
7. **禁止改 metadata / 新增目录后不删 `dataCache.json` 就重启判断生效** —— 必须 `rm /sdcard/pegasus-frontend/dataCache.json` 再 force-stop 重启 `org.pegasus_frontend.android`。
8. **禁止靠改 `game_dirs.txt` 排除目录** —— 天马启动会重写回原样;根治幽灵条目必须删备份目录。
9. **禁止 PSP ROM 只放 TF 卡或删除 app 私有目录那份** —— PPSSPP targetSdk 35 读不到;双份均为必需。
10. **禁止把存档/截图放 `/storage/6AF3-384F/save/`** —— RA 进程无 `sdcard_rw`,只能放 TF 卡 `Android/data/<pkg>/files/`。

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

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).

Content

Scanner excerpt · references/HARD_RULES.md (reported line 74)May include surrounding context.

md
## D. PSP / 显示 / 判定

**18. 禁止 PSP ROM 只放 TF 卡或删掉 app 私有目录那份**
- PPSSPP targetSdk 35 无 `MANAGE_EXTERNAL_STORAGE`,读不到 TF 卡;双份均为必需,拷到 `/storage/emulated/0/Android/data/org.ppsspp.ppsspp/files/` 并 chmod 666。

**19. 禁止用 3.2 秒截图 / 单一亮度阈值 / 文件大小推断黑屏或封面质量**
- 冷启动 8–26 秒(PS 20s、ATOMISWAVE 20s、`PS/射雕英雄传.chd` 368MB 需 15s、MSX 15–18s、泰拉瑞亚/星露谷 15s);首轮 27 DARK / 11 BLACK,8 秒复查后 23 个恢复。

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

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).

Content

Scanner excerpt · references/HARD_RULES.md (reported line 160)May include surrounding context.

md
- 判据是「删掉后功能会不会少」,不是「占多少」。先 `du -s <dir>/*/` 下钻一层,再决定。完整清单见 `PLAYBOOK.md` §12.1。

**33. `.state.auto` 是存档不是缓存;会话 jsonl / sqlite 是正文不是日志**
- `RetroArch/states/*.state.auto`(`savestate_auto_save=true` 每次退出写)代表游戏进度,最大一份 67.5M。要清必须逐份点名,⛔ 不要 `rm states/*.state*`。
- 本机 `$CODEX_HOME/sessions/**/*.jsonl` 是 Codex 对话的 **source of truth**;`~/.workbuddy/projects/**/*.jsonl` 是桌面端本地会话正文(`transport=local` 不上云);`thread_history_1.sqlite` 虽可从 rollout 重建,但必须先备份 + 完全退出 App。⛔ 都不能当「缓存」清掉。
- `~/.workbuddy/logs/sandbox|traces|20XX-XX-XX/` 与 `$CODEX_HOME/logs_2.sqlite` 才是可按日期/保留窗口处理的日志。

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

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).

Content

Scanner excerpt · references/PLAYBOOK.md (reported line 166)May include surrounding context.

bash
adb shell 'cp /sdcard/pegasus-frontend/dataCache.json /sdcard/backup/x.bak'
adb shell 'rm -f /sdcard/pegasus-frontend/dataCache.json'
adb shell 'am force-stop org.pegasus_frontend.android'
adb shell 'am start -n org.pegasus_frontend.android/.MainActivity'

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
86% confidence
Finding

Recommending chmod 666 makes game files writable by every principal that can otherwise reach them, unnecessarily weakening file integrity. Android scoped storage, parent-directory permissions, and SELinux may still prevent other applications from accessing these files, so this is not by itself a sandbox bypass.

Content

Scanner excerpt · references/PLAYBOOK.md (reported line 987)May include surrounding context.

md
- **QML 方法名不能大写**:写 `function S(v)` 会报 `Method names cannot begin with an upper case letter`,整个主题直接加载失败(屏幕显示"主题载入失败 /(ToT)/~~")。缩放函数一律用小写,如 `px()`。

- **`.nomedia`**:Roms / RetroArch / pegasus-frontend / pocketmuseum 四处;隐藏图库素材但不删文件、不影响天马按路径读封面。内部存储 `scan_volume` 立即生效,TF 卡需重启。
- **PPSSPP(v2.1.7 更正)**:targetSdk 35 无 `MANAGE_EXTERNAL_STORAGE`,读不到 TF 卡 ROM,游戏本体必须在 app 私有 `files/`(拷入后 `chmod 666`);TF 卡副本只是天马 `file:` 索引,可用 `.app` 占位替代(去重见禁令 38)。⛔ **启动命令禁止 `-d "file://..."`**:Pegasus 会构造 `Intent.setData()`,Android 7+ 抛 `FileUriExposedException`,前端点了没反应。正确写法 `am start --user 0 -n org.ppsspp.ppsspp/.PpssppActivity --es "org.ppsspp.ppsspp.Shortcuts" "<本体绝对路径>"`(`PpssppActivity.parseIntent()` 在无 data 时读该 extra)。验证必须**从天马前端点击**并看 `logcat` 的 `[BOOT] Booted`,⛔ 不能用 `adb shell am start` 代替(shell 不受 App 级 VmPolicy 约束,是假验证)。RetroArch 无 PPSSPP 核心(加载即崩)。退出回天马用 `VIRTKEY_EXIT_APP` + `PauseMenuExitsEmulator` 兜底,配置与实机确认见 §14。启动与退出详见 §13 / §14。
- **其他**:ATOMOSWAVE 裸 `.bin` 可直接玩(首屏 NOTICE 约 20–30 秒,曾被误判不兼容);但 `