T03 · Remote Payload Retrieval and Execution
- Location
scripts/hm4d_installer.py:143- Finding
Optional installation guidance executes mutable remote code through a shell pipeline
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly coherent for memory optimization, but it needs Review because it can persistently rewrite local memory data and export memory summaries and metadata to remote services with weak safeguards.
Install only if you are comfortable with the skill indexing and rewriting OpenClaw memory files. Keep remote sync and Mem0 sync disabled unless you have reviewed the data being exported and are using an approved HTTPS endpoint. Avoid following the curl-to-shell Ollama fallback, pin chromadb in a controlled environment, and back up memory-records.jsonl before running dedupe, canonicalize, optimize, or gc commands.
scripts/hm4d_installer.py:143Optional installation guidance executes mutable remote code through a shell pipeline
scripts/memory-token-pipeline.py:253Weak sensitivity classification permits confidential memory summaries to be exported to arbitrary remote endpoints
requirements.txt:1Unpinned ChromaDB dependency creates a mutable software supply-chain risk
The script suggests the classic curl | sh pattern for installing Ollama, which executes a network-fetched script without integrity verification. Even though this file only emits the command as fallback guidance, embedding such an unsafe install pattern in an installer materially increases the chance that users or agents will execute arbitrary remote code.
'python_dep': f'{sys.executable} -m pip install chromadb',
'git': 'sudo apt install git',
'python3': 'sudo apt install python3 python3-pip',
'ollama_optional': 'curl -fsSL https://ollama.com/install.sh | sh',
'run_installer': 'bash install.sh',
}
if env['is_windows']:
This code opens the session memory JSONL file in write mode and rewrites its contents, permanently removing duplicate records identified earlier. Although the script prints a summary afterward, there is no pre-action warning, confirmation prompt, or explanatory comment/docstring disclosing that it performs a destructive in-place modification of stored data.
This code opens the backing JSONL store in write mode and rewrites it, permanently removing deduplicated records. Although the script prints a summary afterward, there is no warning, confirmation prompt, or pre-action disclosure before performing this destructive file modification.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def run(cmd):
return subprocess.run(cmd, capture_output=True, text=True, check=False)
def detect():
Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.
missing = []
for dep in PY_DEPS:
try:
__import__(dep)
except Exception:
missing.append(dep)
if not missing:
The script can invoke pip install automatically for missing dependencies, changing the Python environment without an explicit opt-in. In a skill/agent environment this increases risk because dependency installation executes package installation logic and may pull unreviewed code from package indexes.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
if env['is_linux']:
return {
'python_dep': f'{sys.executable} -m pip install chromadb',
'git': 'sudo apt install git',
'python3': 'sudo apt install python3 python3-pip',
'ollama_optional': 'curl -fsSL https://ollama.com/install.sh | sh',
'run_installer': 'bash install.sh',
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
if env['is_linux']:
return {
'python_dep': f'{sys.executable} -m pip install chromadb',
'git': 'sudo apt install git',
'python3': 'sudo apt install python3 python3-pip',
'ollama_optional': 'curl -fsSL https://ollama.com/install.sh | sh',
'run_installer': 'bash install.sh',
The installer creates directories under a workspace path and copies many scripts into that location automatically, without prompting the user or offering a dry-run mode. In an agent-skill context, silent filesystem modification is riskier because execution may occur with limited user visibility, causing persistence or overwriting trusted workspace content.
The manifest declares that raw transcripts are not stored, but the ingest path writes summary text into memory/archive/raw-summaries/*.txt. This creates a security and privacy integrity gap: operators may rely on the manifest to make handling decisions while sensitive content is still being persisted to disk.
The remote sync path uploads summaries and metadata to a remote ChromaDB collection without any interactive confirmation, consent gate, or explicit warning at execution time. Because this pipeline processes memory records that may include internal project context and derived sensitive information, accidental or misunderstood use can cause unintended data exfiltration to external infrastructure.
The Mem0 sync path sends structured memory content and metadata to an external CLI without an execution-path warning or affirmative user acknowledgement. Even though eligibility filtering excludes secret/private labels, this still exports internal memory content to another system and can violate user expectations or data handling requirements.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
}, ensure_ascii=False),
]
try:
result = subprocess.run(cmd, capture_output=True, text=True, check=False)
if result.returncode == 0:
synced.append(record.get("id"))
else:
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
}, ensure_ascii=False),
]
try:
result = subprocess.run(cmd, capture_output=True, text=True, check=False)
if result.returncode == 0:
synced.append(record.get("id"))
else:
The top-level CLI description labels the tool as a '低 Token 記憶管線' and its core commands focus on ingesting, summarizing, indexing, and searching memory. But sync-mem0 invokes an external openclaw mem0 store subprocess for each eligible record at L1422-L1435, which introduces external command execution and propagation into another memory system. Without any manifest purpose available to justify that broader integration, this is a capability expansion beyond the apparent scope of a local memory-token pipeline.
The script dynamically loads and executes Python modules from workspace-controlled paths using importlib without validating provenance, integrity, or trust boundaries. If an attacker can modify files in the workspace or influence OPENCLAW_WORKSPACE, running this benchmark will execute arbitrary code with the user's privileges, making this more dangerous than a simple missing disclosure issue.
The skill instructs users to run bash install.sh directly, which can make arbitrary system changes without any warning, review step, or description of what the script will do. In a package-install context this is a real supply-chain and host-integrity risk, especially since the file also points users to an external GitHub repository for a fuller version.
The dependency is unpinned, so installations may resolve to different versions over time, including newly introduced vulnerable or breaking releases. This weakens reproducibility and makes it harder to verify what code will actually be installed in downstream environments.
chromadb
The manifest references chromadb without a version, while the package family has multiple known advisories including code injection and access-control issues. Because no version is specified, there is no way to determine whether deployment will install a fixed release or a vulnerable one, creating avoidable supply-chain and runtime risk.
The CLI description and help text are presented only in Chinese, which imposes a specific language on users. Under the language/locale policy, this should be configurable or clearly offered as an opt-in unless the tool is explicitly documented as region-specific.
This code creates a reports directory and writes a markdown report to disk, which is a file-write operation covered by the missing-warning rule for code files. There is no confirmation prompt, comment/docstring warning, or prior user-facing disclosure before the write occurs; the only print happens afterward.
This code file contains natural-language strings in Chinese for query behavior, but provides no indication that multilingual or locale-specific behavior is optional or user-selected. Under the policy rule for language or locale constraints, embedding a specific language choice without opt-in can violate organizational language-choice expectations.
The script uses a hard-coded default query string in Traditional Chinese (不存在的查詢測試) when no arguments are provided. This imposes a specific language choice without offering the user any opt-in or locale selection, which is a natural-language policy issue under the locale/language rule.
The script writes a markdown report to the workspace memory/reports directory, which modifies user/project files. While the final JSON output includes the report path after the fact, there is no upfront disclosure in comments, docstrings, or a user-facing message warning that running the script will create or overwrite a report file.