klyc-pmm
KLYC-PMM 存在严重的文档-行为差异:pmm_distill.sh 内嵌 PHP 代码直接访问服务器数据库绕过 API 层,LLM 蒸馏外传 DEEPSEEK_API_KEY,昆仑令明文存储于 MEMORY.md。核心记忆管理功能正常但存在多处声明-实现不符。
Why this conclusion was reached
2/4 dimensions flagged3 undeclared or violating capabilities were inferred.
20 lower-risk artifacts were extracted and still need context.
The report includes 7 attack-chain steps and 2 severe findings.
3 dependency or supply-chain issues need attention.
Attack Chain
Entry · scripts/oneclick.sh:1
Escalation · scripts/oneclick.sh:95
Impact · scripts/oneclick.sh:95
Entry · scripts/pmm_distill.sh:1
Escalation · scripts/pmm_distill.sh:56
Impact · scripts/pmm_distill.sh:108
Impact · scripts/pmm_distill.sh:370
What drove the risk score up
pmm_distill.sh 内嵌 PHP 直接读/kunlunyaochi/config.php 操作数据库,完全绕过文档声明的 HTTPS API
LLM蒸馏将 DEEPSEEK_API_KEY 通过 HTTPS POST 到远程 API,文档仅轻描淡写
昆仑令明文写入 MEMORY.md,脚本自动将其推送到云端 disaster 域
systemd 守护服务在文档中以小字提示,用户可能未充分理解
skill.json 无第三方依赖但运行时依赖 jq/curl 无版本约束
Most important evidence
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 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 昆仑令明文存储并云端同步
昆仑令(恢复凭证)以明文形式写入 MEMORY.md,oneclick.sh 会自动将昆仑令 URL 追加到 MEMORY.md。MEMORY.md 被 watch 守护自动推送到云端 disaster 域,存在泄露风险。若用户将 MEMORY.md 提交到公开仓库,昆仑令将完全暴露。
scripts/oneclick.sh:95 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 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 运行时依赖无版本锁定
skill.json 和 SKILL.md 均声明依赖 jq、curl、inotify-tools,但未指定版本范围。apt/yum/brew install 在不同系统/时间可能安装不同版本,存在供应链风险。
SKILL.md:23 Declared capability vs actual capability
文档声明读写配置文件,代码实际读写 MEMORY.md/SOUL.md 等 scripts/pmm_distill.sh:56-95 PHP 代码直接操作远程数据库 scripts/install-daemon.sh:95-125 创建 systemd service 并执行 systemctl 代码读取 DEEPSEEK_API_KEY/KYLC_API_KEY 等 pmm_distill.sh 扫描 IDENTITY.md 提取昆仑令 pmm_distill.sh:56-95 require '/www/wwwroot/kunlunyaochi/config.php' 并执行 SQL 操作 Suspicious artifacts and egress
https://kunlunyaochi.com。 SKILL.md:24
https://kunlunyaochi.com SKILL.md:26
https://kunlunyaochi.com/?route=services SKILL.md:59
https://kunlunyaochi.com/klyc-pmm/ SKILL.md:107
https://kunlunyaochi.com/?route=onboard SKILL.md:112
https://kunlunyaochi.com/?route=pay&agent=xxx&tier=huhunfu SKILL.md:223
https://kunlunyaochi.com/api/klyc-pmm-pay/resource.php SKILL.md:241
https://skillhub.cn/skillpay references/pay-skill-spec.md:3
https://kunlunyaochi.com/klyc-pmm/...) scripts/pmm_boot.sh:46
https://kunlunyaochi.com/?route=recover scripts/pmm_boot.sh:47
https://kunlunyaochi.com/?route=join scripts/pmm_boot.sh:49
https://kunlunyaochi.com/klyc-pmm/... scripts/pmm_boot.sh:56
Dependencies and supply chain
| Package | Version | Source | Known vuln | Notes |
|---|---|---|---|---|
| jq | * | apt/yum/brew | No | 无版本锁定,建议 >=1.6 |
| curl | * | apt/yum/brew | No | 无版本锁定,建议 >=7.68 |
| inotify-tools | * | apt/yum | No | watch 模式可选依赖 |
File composition
scripts/pmm_watch.sh SKILL.md scripts/pmm_distill.sh scripts/oneclick.sh scripts/install-daemon.sh references/pay-skill-spec.md scripts/pmm_boot.sh scripts/pmm_recover.sh