klyc-pmm
KLYC-PMM 存在严重的文档-行为差异:pmm_distill.sh 内嵌 PHP 代码直接访问服务器数据库绕过 API 层,LLM 蒸馏外传 DEEPSEEK_API_KEY,昆仑令明文存储于 MEMORY.md。核心记忆管理功能正常但存在多处声明-实现不符。
为什么得出这个结论
2/4 个维度触发发现 3 项声明之外的能力或越权行为。
提取到 20 个一般风险产物,需要结合上下文判断。
报告包含 7 步攻击链,另有 2 项高危或严重发现。
发现 3 项需要关注的依赖或供应链线索。
攻击链
初始入口 · scripts/oneclick.sh:1
权限提升 · scripts/oneclick.sh:95
最终危害 · scripts/oneclick.sh:95
初始入口 · scripts/pmm_distill.sh:1
权限提升 · scripts/pmm_distill.sh:56
最终危害 · scripts/pmm_distill.sh:108
最终危害 · scripts/pmm_distill.sh:370
风险分是怎么被拉高的
pmm_distill.sh 内嵌 PHP 直接读/kunlunyaochi/config.php 操作数据库,完全绕过文档声明的 HTTPS API
LLM蒸馏将 DEEPSEEK_API_KEY 通过 HTTPS POST 到远程 API,文档仅轻描淡写
昆仑令明文写入 MEMORY.md,脚本自动将其推送到云端 disaster 域
systemd 守护服务在文档中以小字提示,用户可能未充分理解
skill.json 无第三方依赖但运行时依赖 jq/curl 无版本约束
最关键的证据
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 声明能力 vs 实际能力
文档声明读写配置文件,代码实际读写 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 操作 可疑产物与外联
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
依赖与供应链
| 包名 | 版本 | 来源 | 漏洞 | 备注 |
|---|---|---|---|---|
| jq | * | apt/yum/brew | 否 | 无版本锁定,建议 >=1.6 |
| curl | * | apt/yum/brew | 否 | 无版本锁定,建议 >=7.68 |
| inotify-tools | * | apt/yum | 否 | watch 模式可选依赖 |
文件构成
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