Back to skill

Security audit

Synapse Brain

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed persistent task-orchestration skill, but it needs Review because its state-file code can escape the intended directory and its installer can delete an existing install without explicit force.

Review before installing. This skill stores project/task/subagent state locally under ~/.openclaw/brain-state and installs into ~/.openclaw/skills. Avoid sensitive project names or task data until path validation and retention controls are fixed, do not reinstall over a customized copy without backup, and prefer a pinned or locally reviewed installer over the unpinned npx command.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/state_manager.py:24
Finding

Path Traversal Enables Arbitrary JSON File Read and Overwrite

Content
View full analysis
str: return os.path.join(STATE_DIR, f"{project}.json") ``` The resulting path is used directly by the state creation, loading, and saving operations: ```python def create(project: str, title: str): """Create a new session state.""" _ensure_state_dir() path = _state_path(project) if os.path.exists(path): print(f"[brain] Session already exists for '{project}'. Use 'update' to modify.") return _load(project) state = { "session_id": f"sess_{datetime.now(timezone.utc).strftime('%Y%m%d_%H%M%S')}", "project": project, "title": title, "created_at": _now(), "updated_at": _now(), "tasks": [], "subagents": { "active": 0, "completed": 0, "failed": 0 }, "knowledge": { "wiki_initialized": False, "wiki_root": None, "last_ingest": None }, "log": [] } with open(path, "w") as f: json.dump(state, f, indent=2) print(f"[brain] Session created: {project} — {title}") return state ``` ```python def _load(project: str) -> dict | None: path = _state_path(project) if not os.path.exists(path): print(f"[brain] No session found for '{project}'.") return None with open(path) as f: return json.load(f) def _save(project: str, state: dict): _ensure_state_dir() state["updated_at"] = _now() with open(_state_path(project), "w") as f: json.dump(state, f, indent=2) print(f"[brain] State saved: {project}") ``` ### Technical Analysis The `project` argument is controlled through command-line operations and is interpolated directly into a filesystem ...[truncated 2031 chars]
Remediation
View remediation
str: if not PROJECT_PATTERN.fullmatch(project): raise ValueError("Invalid project identifier") return project ``` 2. Resolve the final path and verify that it remains inside the state directory: ```python STATE_ROOT = Path(STATE_DIR).resolve() def _state_path(project: str) -> Path: validate_project(project) candidate = (STATE_ROOT / f"{project}.json").resolve() if candidate.parent != STATE_ROOT: raise ValueError("State path escapes the state directory") return candidate ``` 3. Reject absolute paths, path separators, `..`, null bytes, and platform-specific alternate separators before filesystem access. 4. Prevent symbolic-link attacks by checking that existing files are regular files and opening them with `O_NOFOLLOW` where supported. 5. Write state atomically to a securely created temporary file in `STATE_DIR`, apply restrictive permissions such as `0600`, call `fsync()`, and replace the destination with `os.replace()`. 6. Add tests covering absolute paths, nested traversal, encoded or alternate separators, symlink targets, and race conditions. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:202
Finding

Unpinned npx Installation Executes Mutable Third-Party Package Code

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
install.sh:45
Finding

Installer Deletes Existing Skill Directory Without Requiring Force

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (25)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The file presents the skill as a durable multi-agent scheduler with persistence and knowledge interoperability, but the visible content does not demonstrate those controls or persistence mechanisms beyond descriptive examples. Such description-behavior mismatch can cause unsafe deployment decisions, especially when users expect only routing but the skill may also create local state or invoke other components.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The file presents the skill as a durable multi-agent scheduler with persistence and knowledge interoperability, but the visible content does not demonstrate those controls or persistence mechanisms beyond descriptive examples. Such description-behavior mismatch can cause unsafe deployment decisions, especially when users expect only routing but the skill may also create local state or invoke other components.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The file presents the skill as a durable multi-agent scheduler with persistence and knowledge interoperability, but the visible content does not demonstrate those controls or persistence mechanisms beyond descriptive examples. Such description-behavior mismatch can cause unsafe deployment decisions, especially when users expect only routing but the skill may also create local state or invoke other components.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file states that the skill persists session state to state.json, which can affect user data and privacy across sessions. The description does not include any warning that conversations or project state will be stored, nor guidance on retention, location, or how to disable it.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README says installation automatically generates config.json and that auto_save is enabled by default with a periodic interval. For a markdown skill description, this is a behavior affecting system integrity and user data, but no warning or disclosure is provided about automatic file creation and repeated state writes.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill advertises behavior that persists session state and manages project data, which implies filesystem writes, but it does not declare any explicit tool scope such as permissions or allowed-tools. That creates a transparency and least-privilege problem: a user or host may invoke a skill that can write local files without a clearly bounded authorization model.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill describes storing cross-session data in state.json, including project names, task history, agent usage, and knowledge paths, but it does not provide a user-facing warning about persistent storage. This is a security and privacy issue because users may unknowingly leave sensitive operational context on disk across sessions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill advertises automatic subagent dispatch, including parallel execution and a deployment-capable pipeline, without a clear warning about autonomous action and downstream effects. In context, an orchestration skill is more dangerous than a simple helper because it can amplify mistakes by triggering multiple agents or deployment stages from a single request.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

The installation instructions reference 'npx clawhub install synapse-brain' without pinning a specific package version or integrity constraint. This creates a supply-chain risk because a future malicious, compromised, or incompatible package version could be fetched and executed at install time.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly instructs the agent to maintain cross-session state and restore prior context, which creates a real risk of persisting user-provided sensitive information beyond the original interaction. In a scheduler/orchestrator skill, this is more dangerous because it aggregates context from multiple tasks and sessions, increasing both the amount of retained data and the chance it is surfaced later to the wrong task, user context, or sub-agent.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The instruction to record session activity into the persistent log field is a concrete over-retention risk because it encourages saving broad conversational or operational history without any sensitivity filtering. Given this skill’s role as a central coordinator, those logs may include outputs from multiple sub-agents, compounding exposure of secrets, personal data, or proprietary information across sessions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Most user-visible help, status, and usage text is presented only in Chinese, with no language selection or opt-in. This can violate language or locale policy where tools should not force a specific language on users without choice or explicit justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script deletes the existing installation directory with rm -rf during both forced and normal install paths, and also removes it on uninstall. Although it logs the action, there is no user confirmation before the destructive operation, which reduces user awareness for a data-affecting action.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · install.sh (reported line 63)May include surrounding context.

sh
return 0
    fi

    # Create parent directory
    mkdir -p "$(dirname "$SKILL_DEST")"

    # Copy skill files

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The top-level description includes a Chinese-only statement about the skill's behavior, which imposes a specific language/locale presentation without any indication of user opt-in or alternative language support. This matches the policy concern for language or locale constraints expressed in natural language.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/state_manager.py (reported line 7)May include surrounding context.

python
持久化 Session 状态,支持跨会话恢复。

Usage:
    python state_manager.py create <project> <title>
    python state_manager.py update <project> <task_id> <status> [data]
    python state_manager.py status <project>
    python state_manager.py list

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The archive function deletes completed tasks from the active task list and persists the modified state, which is a destructive operation affecting stored user data. Although the function prints the number archived afterward, there is no prior confirmation prompt or explicit warning that task entries will be removed from the session state.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The function docstring says 'Manually retry a failed subagent,' which implies retries are limited to failed executions. However, the code explicitly permits retry when status is either 'failed' or 'completed', so successfully completed subagents can be reset and re-run as well.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The document is written entirely in Chinese, including headings and operational descriptions, with no indication that users may choose another language or that the skill is region-specific. Under the stated policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The script executes python3 -m py_compile on files in the installed skill as part of post-install validation. While this is likely benign, the script does not disclose ahead of time that it will invoke an external interpreter, and there is no nearby comment or user-facing message describing this subprocess behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file includes architecture labels and component descriptions in Chinese alongside English, such as the orchestrator and script role annotations. Because the document does not explain that it is intended for a Chinese-speaking audience or offer an alternative language, it may violate the language/locale policy requiring user choice or justified constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The module header presents the session description in Chinese ("初始化新 Session 或恢复已有 Session。") while the rest of the CLI usage is in English. This imposes a language choice in user-facing text without opt-in or justification, which can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

When interrupted tasks are found, the code silently changes their status to "interrupted" and updates a timestamp during a resume operation. Although the script prints that interrupted tasks were found, it does not disclose beforehand that resuming will mutate persisted task state, and this file provides no confirmation prompt or explanatory warning about that write-like side effect.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The top-level natural-language description includes a Chinese-only statement describing the skill, with no indication that users may choose another language or locale. This can violate language/locale policy expectations because the file presents a fixed language preference without opt-in or region-specific justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The module docstring and usage examples are primarily presented in Chinese, and the routing logic is heavily oriented around Chinese trigger phrases. This can constitute a locale/language policy concern because the skill appears to default to a specific language without documenting user opt-in or offering an explicit language choice.

Content

No source excerpt is available for this finding.