layered-memory
代码引用 ~/clawd/scripts/ 下的外部脚本(memory-extractor.js, memory-archiver.js, generate-layers-simple.js, memory-reader.js)但这些脚本未打包在技能目录中;此外 SKILL.md 声明了 4 个命令但代码实际实现了 9 个(extract/archive/summary/dedupe 未声明)。
Why this conclusion was reached
2/4 dimensions flagged2 undeclared or violating capabilities were inferred.
No obvious high-risk egress or execution signals were found.
The report includes 4 attack-chain steps and 2 severe findings.
Dependencies are present but no obvious high-risk issue stands out.
Attack Chain
Entry · SKILL.md:1
Escalation · index.js:29
Escalation · index.js:40
Impact · index.js:40
What drove the risk score up
index.js 使用 execSync 执行外部 JS 脚本,但 SKILL.md 未声明 shell:WRITE 能力
代码 require ~/clawd/scripts/ 下的 4 个脚本但未打包,运行时必然失败或依赖外部污染
SKILL.md 只声明 4 个命令,实际实现了 9 个(extract/archive/summary/dedupe)
Most important evidence
外部脚本缺失导致功能不可用
index.js 第 29-31 行 require ~/clawd/scripts/ 下的 memory-extractor.js 和 memory-archiver.js,第 40-58 行的 generate/read/search/stats 方法通过 execSync 调用 ~/clawd/scripts/ 下的 generate-layers-simple.js 和 memory-reader.js,但这 4 个脚本均未打包在技能目录中。运行时必然报错,除非用户在 ~/clawd/scripts/ 下自行准备这些脚本。
index.js:29-58 SKILL.md 声明命令与实际不符
SKILL.md 只声明了 generate、read、search、stats 四个命令,但 index.js 实际实现了 9 个 CLI 命令(generate、read、search、stats、maintain、extract、archive、summary、dedupe),其中 extractMemories、archiveOld、monthlySummary、deduplicate 为阴影功能。
index.js:145-218 test.js 对外部路径存在性检查
test.js 第 75-86 行检查 ~/clawd/scripts/generate-layers-simple.js 是否存在,并读取其内容验证 v2 功能。这意味着 test 依赖于用户环境中有该脚本,技能自身不完整。
test.js:75-86 benchmark.js 包含硬编码用户路径
benchmark.js 第 56-57 行硬编码了 /root/.openclaw/workspace/memory/ 路径,非可移植路径。
benchmark.js:56-57 OpenClaw hook 未在 SKILL.md 中声明
package.json 注册了 openclaw hooks (agent:bootstrap 事件注入记忆提醒),但 SKILL.md 未提及此行为。
package.json:19-26 Declared capability vs actual capability
index.js:29-31 代码执行 fs.readFileSync/writeFileSync index.js:40-58 使用 execSync 调用外部脚本 index.js:29-31 require(~/clawd/scripts/memory-extractor.js) 等外部模块 Suspicious artifacts and egress
No obvious IOC was extracted.
Dependencies and supply chain
| Package | Version | Source | Known vuln | Notes |
|---|---|---|---|---|
| memory-extractor.js | N/A | ~/.clawd/scripts/ (external, not bundled) | No | 高风险:外部脚本未打包,依赖用户环境存在 |
| memory-archiver.js | N/A | ~/.clawd/scripts/ (external, not bundled) | No | 高风险:外部脚本未打包,依赖用户环境存在 |
| generate-layers-simple.js | N/A | ~/.clawd/scripts/ (external, not bundled) | No | 高风险:外部脚本未打包,依赖用户环境存在 |
| memory-reader.js | N/A | ~/.clawd/scripts/ (external, not bundled) | No | 高风险:外部脚本未打包,依赖用户环境存在 |
File composition
index.js test.js benchmark.js