Skill Trust Decision

klyc-pmm

KLYC-PMM 存在严重的文档-行为差异:pmm_distill.sh 内嵌 PHP 代码直接访问服务器数据库绕过 API 层,LLM 蒸馏外传 DEEPSEEK_API_KEY,昆仑令明文存储于 MEMORY.md。核心记忆管理功能正常但存在多处声明-实现不符。

Install decision first Source: ClawHub Scanned: 28 days ago
Files 14
Artifacts 20
Violations 3
Findings 6
Most direct threat evidence
01
用户执行 ./scripts/oneclick.sh 安装技能 Entry · scripts/oneclick.sh
02
昆仑令被写入 MEMORY.md 并通过 watch 自动云端同步 Escalation · scripts/oneclick.sh
03
昆仑令泄露:用户将含令的 MEMORY.md 提交到 GitHub Impact · scripts/oneclick.sh

Why this conclusion was reached

2/4 dimensions flagged
Block
Declared vs actual capability

3 undeclared or violating capabilities were inferred.

Review
Hidden execution and egress

20 lower-risk artifacts were extracted and still need context.

Block
Attack chain and severe findings

The report includes 7 attack-chain steps and 2 severe findings.

Review
Dependencies and supply chain hygiene

3 dependency or supply-chain issues need attention.

Attack Chain

01
用户执行 ./scripts/oneclick.sh 安装技能

Entry · scripts/oneclick.sh:1

02
昆仑令被写入 MEMORY.md 并通过 watch 自动云端同步

Escalation · scripts/oneclick.sh:95

03
昆仑令泄露:用户将含令的 MEMORY.md 提交到 GitHub

Impact · scripts/oneclick.sh:95

04
管理员执行 pmm_distill.sh 进行记忆蒸馏

Entry · scripts/pmm_distill.sh:1

05
PHP 代码读取 /www/wwwroot/kunlunyaochi/config.php 获取数据库凭证

Escalation · scripts/pmm_distill.sh:56

06
直接 SQL 操作修改用户记忆数据,绕过 API 鉴权

Impact · scripts/pmm_distill.sh:108

07
LLM 蒸馏将 DEEPSEEK_API_KEY 发送到远程平台

Impact · scripts/pmm_distill.sh:370

What drove the risk score up

文档-行为严重不符 +20

pmm_distill.sh 内嵌 PHP 直接读/kunlunyaochi/config.php 操作数据库,完全绕过文档声明的 HTTPS API

凭证外传未充分声明 +12

LLM蒸馏将 DEEPSEEK_API_KEY 通过 HTTPS POST 到远程 API,文档仅轻描淡写

昆仑令存储风险 +8

昆仑令明文写入 MEMORY.md,脚本自动将其推送到云端 disaster 域

持久化未充分说明 +5

systemd 守护服务在文档中以小字提示,用户可能未充分理解

依赖无版本锁定 +3

skill.json 无第三方依赖但运行时依赖 jq/curl 无版本约束

Most important evidence

High Doc Mismatch

pmm_distill.sh 内嵌 PHP 直接操作服务器数据库

pmm_distill.sh 包含 PHP 代码段,生成后写入 /tmp/*.php 并执行。PHP 代码中硬编码 require '/www/wwwroot/kunlunyaochi/config.php' 并直接调用 getMemoriesTable(${USER_ID}) 执行 SELECT/UPDATE SQL 操作。这完全绕过文档声明的 HTTPS API 层,表明该脚本实际被设计为在 kunlunyaochi.com 服务器端运行,而非文档所述的客户端工具。

scripts/pmm_distill.sh:56
删除所有内嵌 PHP 代码,使用文档声明的 HTTPS REST API 进行记忆操作
High Credential Theft

LLM 蒸馏外传 DEEPSEEK_API_KEY

pmm_distill.sh 的 distill_with_llm() 函数将用户的 DEEPSEEK_API_KEY 放入 HTTP 请求头发送到远程平台 API:curl -H "Authorization: Bearer ${api_key}" https://api.deepseek.com/v1/chat/completions。虽然目标为官方 API,但用户密钥被传输到第三方(kunlunyaochi.com)控制的端点进行中转,密钥流经平台服务器。

scripts/pmm_distill.sh:370
在本地直接调用 DeepSeek API,避免密钥经过第三方服务器
Medium Sensitive Access

昆仑令明文存储并云端同步

昆仑令(恢复凭证)以明文形式写入 MEMORY.md,oneclick.sh 会自动将昆仑令 URL 追加到 MEMORY.md。MEMORY.md 被 watch 守护自动推送到云端 disaster 域,存在泄露风险。若用户将 MEMORY.md 提交到公开仓库,昆仑令将完全暴露。

scripts/oneclick.sh:95
昆仑令应仅存储在本地加密存储或用户离线密码管理器,不应云端同步
Medium Priv Escalation

install-daemon.sh 创建 systemd 服务

install-daemon.sh 写入 /etc/systemd/system/klyc-pmm-watch.service 并执行 systemctl daemon-reload/enable/restart。虽然文档中有小字提及"安装 systemd 守护服务",但作为可选功能应更显著声明持久化影响。守护进程会在系统启动时自动运行,消耗内存(Capped at 32M)。

scripts/install-daemon.sh:95
将 systemd 安装作为明确选项而非默认行为,提供 --no-daemon 选项
Medium Doc Mismatch

pmm_distill.sh 数据库操作涉及数据篡改

pmm_distill.sh 的 auto_dedup() 和 auto_resolve() 通过 PHP 代码直接执行 UPDATE SET is_deleted=1 对用户记忆进行软删除标记,覆盖比例高达 50% 冗余内容。auto_resolve() 更是硬编码判断逻辑(如 '8767引用未标注下线'),可绕过用户意愿修改记忆状态。

scripts/pmm_distill.sh:108
蒸馏结果应通过文档声明的 API 由服务端执行,而非客户端直接修改
Low Supply Chain

运行时依赖无版本锁定

skill.json 和 SKILL.md 均声明依赖 jq、curl、inotify-tools,但未指定版本范围。apt/yum/brew install 在不同系统/时间可能安装不同版本,存在供应链风险。

SKILL.md:23
声明最小版本要求:jq>=1.6, curl>=7.68

Declared capability vs actual capability

Filesystem Pass
Declared WRITE
Inferred WRITE
文档声明读写配置文件,代码实际读写 MEMORY.md/SOUL.md 等
Network Block
Declared HTTPS_API
Inferred FULL_CONTROL
scripts/pmm_distill.sh:56-95 PHP 代码直接操作远程数据库
Shell Block
Declared NONE
Inferred WRITE
scripts/install-daemon.sh:95-125 创建 systemd service 并执行 systemctl
Environment Pass
Declared READ
Inferred READ
代码读取 DEEPSEEK_API_KEY/KYLC_API_KEY 等
Skill Invoke Block
Declared NONE
Inferred READ
pmm_distill.sh 扫描 IDENTITY.md 提取昆仑令
Database Pass
Declared NONE
Inferred ADMIN
pmm_distill.sh:56-95 require '/www/wwwroot/kunlunyaochi/config.php' 并执行 SQL 操作

Suspicious artifacts and egress

Medium External URL
https://kunlunyaochi.com。

SKILL.md:24

Medium External URL
https://kunlunyaochi.com

SKILL.md:26

Medium External URL
https://kunlunyaochi.com/?route=services

SKILL.md:59

Medium External URL
https://kunlunyaochi.com/klyc-pmm/

SKILL.md:107

Medium External URL
https://kunlunyaochi.com/?route=onboard

SKILL.md:112

Medium External URL
https://kunlunyaochi.com/?route=pay&agent=xxx&tier=huhunfu

SKILL.md:223

Medium External URL
https://kunlunyaochi.com/api/klyc-pmm-pay/resource.php

SKILL.md:241

Medium External URL
https://skillhub.cn/skillpay

references/pay-skill-spec.md:3

Medium External URL
https://kunlunyaochi.com/klyc-pmm/...)

scripts/pmm_boot.sh:46

Medium External URL
https://kunlunyaochi.com/?route=recover

scripts/pmm_boot.sh:47

Medium External URL
https://kunlunyaochi.com/?route=join

scripts/pmm_boot.sh:49

Medium External URL
https://kunlunyaochi.com/klyc-pmm/...

scripts/pmm_boot.sh:56

Dependencies and supply chain

PackageVersionSourceKnown vulnNotes
jq * apt/yum/brew No 无版本锁定,建议 >=1.6
curl * apt/yum/brew No 无版本锁定,建议 >=7.68
inotify-tools * apt/yum No watch 模式可选依赖

File composition

14 files · 4253 lines
Shell 8 files · 3117 linesMarkdown 5 files · 1081 linesJSON 1 files · 55 lines
Files of concern · 8
scripts/pmm_watch.sh Shell · 1941 lines
https://kunlunyaochi.com/skills/klyc-pmm/scripts/pmm_watch.sh · https://kunlunyaochi.com/?route=recharge$ · https://kunlunyaochi.com/?route=dashboard · https://kunlunyaochi.com/?route=pay&agent=$ · https://kunlunyaochi.com/?route=klyc-pmm
SKILL.md Markdown · 674 lines
运行时依赖无版本锁定 · https://kunlunyaochi.com。 · https://kunlunyaochi.com · https://kunlunyaochi.com/?route=services · https://kunlunyaochi.com/klyc-pmm/ · https://kunlunyaochi.com/?route=onboard · https://kunlunyaochi.com/?route=pay&agent=xxx&tier=huhunfu · https://kunlunyaochi.com/api/klyc-pmm-pay/resource.php
scripts/pmm_distill.sh Shell · 421 lines
pmm_distill.sh 内嵌 PHP 直接操作服务器数据库 · LLM 蒸馏外传 DEEPSEEK_API_KEY · pmm_distill.sh 数据库操作涉及数据篡改 · https://api.deepseek.com/v1/chat/completions
scripts/oneclick.sh Shell · 217 lines
昆仑令明文存储并云端同步
scripts/install-daemon.sh Shell · 198 lines
install-daemon.sh 创建 systemd 服务
references/pay-skill-spec.md Markdown · 59 lines
https://skillhub.cn/skillpay
scripts/pmm_boot.sh Shell · 59 lines
https://kunlunyaochi.com/klyc-pmm/...) · https://kunlunyaochi.com/?route=recover · https://kunlunyaochi.com/?route=join · https://kunlunyaochi.com/klyc-pmm/...
scripts/pmm_recover.sh Shell · 44 lines
https://kunlunyaochi.com/klyc-pmm/TOKEN · https://kunlunyaochi.com/api
Other files · pmm-full-architecture.md · CHANGELOG.md · pmm_backup_files.sh · quickstart.sh

Security positives

核心记忆 push/search/recover 功能正常,API 层设计合理
退出码体系完整,自检功能( self-test)幂等安全
网络通信强制 HTTPS/TLS(--ssl-reqd),数据传输加密
昆仑令格式校验(v8.3.3),防止格式错误导致泄露
配额系统限制恶意滥用
X402 微信支付流程清晰,不越权扣款