T06 · System Persistence
- Location
SKILL.md:58- Finding
Persistent Auto-Start Service Exceeds Minimum Privileges
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a real local memory setup guide, but it asks users to run unpinned external code, enable persistence, and import/share sensitive agent memories in ways that need careful review.
Install only if you are comfortable with a shared long-term memory pool across agents, third-party processing of memory snippets, and running an external repository's code. Before use, pin the repo to a reviewed commit, keep the endpoint loopback-only, review/redact imported workspace files, avoid system-wide auto-start, and prefer user-level service configuration with secure secret storage.
SKILL.md:58Persistent Auto-Start Service Exceeds Minimum Privileges
scripts/import_openclaw_memories.py:15Sensitive Workspace Memories Can Be Sent to an Arbitrary Endpoint
scripts/import_openclaw_memories.py:16Unified Memory Identity Breaks Cross-Agent Isolation
SKILL.md:22Mutable Remote Repository Is Retrieved, Built, and Persistently Executed
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
def check_health():
"""Check mem0 server is running."""
try:
r = requests.get(f"{MEM0_URL}/api/health", timeout=5)
data = r.json()
if data.get("status") == "ok":
print(f"✅ mem0 server healthy (memories: {data.get('total_memories', '?')})")
The script reads MEMORY.md and TOOLS.md from multiple workspaces and posts their contents to whatever endpoint MEM0_URL specifies, without restricting that destination to a local trusted service. If MEM0_URL is changed to a remote or attacker-controlled host, sensitive cross-session memory content can be exfiltrated in bulk; the unified user_id also aggregates all agents' data, increasing blast radius.
def add_memory(text: str, source_agent: str, source_file: str) -> bool:
"""Add a memory to mem0 with unified user_id and source metadata."""
try:
r = requests.post(
f"{MEM0_URL}/api/memory/add",
json={
"text": text,
The description emphasizes a local memory plugin setup, but the guide also instructs importing data from all agent workspaces, sharing one memory pool across agents, and transmitting snippets to external LLM/embedding providers. This mismatch is dangerous because it can cause operators to approve or run the skill under an incomplete understanding of its data collection, cross-agent exposure, and outbound data flows.
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
```bash
sudo systemctl enable mem0 && sudo systemctl start mem0
Verify:
The skill instructs users to clone a repo, run shell scripts, use environment variables, access local files, and perform network/API operations, but it does not declare any tool scope or permissions metadata. That omission reduces transparency and weakens policy enforcement, making it easier for a high-capability skill to be invoked without users or the platform clearly understanding its access needs.
Copying a launchd plist into LaunchAgents prepares the service to run persistently for the user account. Because the plist may contain API keys and defines automatic execution of a local server, this persistence should be considered sensitive and disclosed more prominently.
# Copy and edit the template — replace $HOME, API keys, proxy settings
cp launchd/ai.openclaw.mem0.plist ~/Library/LaunchAgents/
# IMPORTANT: edit the plist to fill in your actual paths and API keys
nano ~/Library/LaunchAgents/ai.openclaw.mem0.plist
# Load the service
Editing a launchd plist to include paths and API keys supports a persistent agent process and may encourage secret placement in a long-lived config file. This is risky because it combines automatic execution with potentially sensitive credential storage in user-managed files.
# Copy and edit the template — replace $HOME, API keys, proxy settings
cp launchd/ai.openclaw.mem0.plist ~/Library/LaunchAgents/
# IMPORTANT: edit the plist to fill in your actual paths and API keys
nano ~/Library/LaunchAgents/ai.openclaw.mem0.plist
# Load the service
launchctl load ~/Library/LaunchAgents/ai.openclaw.mem0.plist
Loading the launchd plist activates a persistent background service. Given that the service handles memory ingestion and may forward snippets to external APIs, automatic execution increases the chance of unnoticed long-term data processing if users do not fully understand the behavior.
cp launchd/ai.openclaw.mem0.plist ~/Library/LaunchAgents/
nano ~/Library/LaunchAgents/ai.openclaw.mem0.plist
launchctl load ~/Library/LaunchAgents/ai.openclaw.mem0.plist
This duplicate finding points to the same launchd persistence behavior at the same location. The security concern is the same: automatic background execution of a data-processing service with external API dependencies.
nano ~/Library/LaunchAgents/ai.openclaw.mem0.plist
launchctl load ~/Library/LaunchAgents/ai.openclaw.mem0.plist
**Option C — Linux systemd:**
This duplicate finding points to the same launchd persistence behavior at the same location. The security concern is the same: automatic background execution of a data-processing service with external API dependencies.
nano ~/Library/LaunchAgents/ai.openclaw.mem0.plist
launchctl load ~/Library/LaunchAgents/ai.openclaw.mem0.plist
**Option C — Linux systemd:**
Creating a systemd unit file is part of setting up persistent background execution. In the context of a memory service that may read/import workspace data and contact third-party APIs, persistence materially increases exposure duration and should be treated as a security-relevant behavior, not just installation detail.
Option C — Linux systemd:
Create /etc/systemd/system/mem0.service:
[Unit]
Description=mem0 local memory server
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
```bash
sudo systemctl enable mem0 && sudo systemctl start mem0
Verify:
Enabling a service at boot establishes persistence on the host, which is a sensitive capability even when presented as a convenience feature. Persistent services can continue processing local data and making outbound API calls across sessions, so users must clearly understand and consent to this ongoing behavior.
```bash
sudo systemctl enable mem0 && sudo systemctl start mem0
Verify:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
Verify:
curl http://127.0.0.1:8300/api/health
# Should return {"status": "ok", ...}
This code intentionally transmits local memory files to an external HTTP API endpoint. In the context of a memory-import skill, that behavior is expected, but it is still security-sensitive because the imported files may contain secrets, internal instructions, or other sensitive agent state, and the destination is configurable rather than strongly bound to a local service.
def add_memory(text: str, source_agent: str, source_file: str) -> bool:
"""Add a memory to mem0 with unified user_id and source metadata."""
try:
r = requests.post(
f"{MEM0_URL}/api/memory/add",
json={
"text": text,
No suspicious patterns detected.