Env credential access
- Finding
- Environment variable access combined with network send.
Security checks across static analysis, malware telemetry, and agentic risk
This memory skill is purpose-aligned, but it needs review because it can access files outside its memory folder, builds shell commands from memory/search text, and can automatically send private memories to an external LLM.
Install only if you are comfortable with persistent memories being stored locally and, when AutoDream is enabled with a MiniMax key, sent to MiniMax for consolidation. Before using it, restrict memory_get and memory_write to the memory directory, fix the shell-based Ollama call, disable or review AutoDream by default, and add backups for memory changes.
VirusTotal findings are pending for this skill version.
Artifact-based informational review of SKILL.md, metadata, install specs, static scan signals, and capability signals. ClawScan does not execute the skill or run runtime probes.
A crafted memory entry or search query could potentially cause unintended local commands to run with the agent's permissions.
The skill constructs a shell command with embedding text inserted into a quoted curl command and executes it via execAsync. Only double quotes are escaped, so search queries or memory contents containing shell metacharacters such as single quotes could break out of the command.
const curlCmd = `curl -s http://localhost:11434/api/embeddings -d '{"model": "${model}", "prompt": "${cleanText.replace(/\"/g, '\\\"')}"}'`;
const { stdout } = await execAsync(curlCmd, { timeout: 30000 });Avoid shell construction for embeddings; call Ollama with a safe HTTP client or spawn curl with an argument array, and validate or escape all user-controlled text.
If the tool is invoked with an absolute path or ../ traversal, it may read arbitrary files accessible to the OpenClaw process rather than only memory files.
The memory_get path resolver allows absolute paths and does not normalize-and-check that relative paths stay inside memoryDir. This contradicts the tool description that paths are relative to the memory directory.
if (!path.isAbsolute(p)) {
return path.join(baseDir, p);
}
return path.resolve(p);Constrain memory_get to the configured memory directory by resolving the final path and rejecting absolute paths or paths that escape the directory.
The agent could overwrite or create files outside the intended memory store if given or induced to use an unsafe path.
The memory_write path resolver also allows absolute paths or traversal outside memoryDir, and the overwrite mode writes directly to the resolved path.
if (!path.isAbsolute(p)) {
return path.join(baseDir, p);
}
return path.resolve(p);
...
await fs.writeFile(fullPath, content, 'utf-8');Restrict writes to a safe memory subtree, reject traversal and absolute paths, and consider requiring explicit user confirmation for overwrite mode.
Private user preferences, feedback, project details, or references stored as memories may be transmitted to MiniMax during automatic consolidation.
AutoDream builds a prompt from memory file contents and sends it to the external MiniMax API. The skill documents User and Feedback memories as private, and AutoDream is enabled by default.
await fetch('https://api.minimaxi.com/anthropic/v1/messages', {
method: 'POST',
headers: { ... 'Authorization': `Bearer ${apiKey}` ... },
body: JSON.stringify({ ... messages: [ { role: 'user', content: prompt } ] })
});
...
.map(f => `## ${f.relativePath}\n${f.content.slice(0, 3000)}`)Make external LLM use opt-in, clearly declare the MiniMax credential and data sharing, provide redaction/exclusion controls, and require approval before sending private memories.
A mistaken or manipulated consolidation could remove or rewrite memories and affect future agent sessions.
The documented default workflow lets a scheduled LLM process automatically mutate persistent memory state, including deletion and index updates, without describing a dry run, approval gate, backup, or rollback.
定时触发 (每天 22:00) 或 手动触发
↓
扫描所有记忆文件 + 会话历史
↓
调用 MiniMax LLM 分析
↓
自动执行整合:
- 新增遗漏的记忆
- 删除过时的记忆
- 更新 MEMORY.md 索引Use a review-before-apply workflow for AutoDream changes, keep backups/version history, and show users exactly which memory files will be added, deleted, or updated.
Incorrect, stale, or maliciously edited memory files could steer future responses.
Automatic loading of persistent memories is central to this skill, but it means stored content can influence later sessions and should be treated as user-editable context rather than trusted instructions.
"hooks": {
"onSessionStart": {
"description": "会话启动时自动加载记忆"
},
"onHeartbeat": {
"description": "心跳时检查并触发 AutoDream"
}
}Review memory files periodically, separate facts from instructions, and ensure the agent treats loaded memories as context that can be challenged or confirmed.
Users may not realize the skill can use a local MiniMax credential for external API calls.
The code reads a MiniMax API key from configuration or environment, while the registry metadata lists no required environment variables or primary credential.
if (config.autoDream.apiKey.startsWith('env:')) {
const envVar = config.autoDream.apiKey.slice(4);
return process.env[envVar];
}
...
return process.env.MINIMAX_CODING_API_KEY;Declare the MiniMax credential in metadata and document when it is used, what data is sent, and how to disable it.