Back to skill

Security audit

Agent Comm Protocol

Security checks for vulnerabilities and agentic risk

Overview

This is a simple inter-agent communication protocol, with a disclosed but privacy-sensitive logging convention users should configure carefully.

Before installing, treat the communication log as persistent local records: do not include secrets, tokens, personal data, or confidential task details unless your OpenClaw environment applies appropriate file permissions, redaction, path validation, and retention controls.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:76
Finding

Persistent Plaintext Logging of Potentially Sensitive Agent Communications

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 76–79
Vulnerability Type: Plaintext storage of potentially sensitive communication data
Risk Level: Medium

Vulnerable Code Snippet

English rendering of the complete relevant directive:

text
All communication records are stored in:
- `/root/.openclaw/agents/{agent_id}/communications/{date}.md`

Technical Analysis

The Skill directs agents to persist all communications as Markdown files under the root user's OpenClaw state directory. The recorded messages may include task instructions, status reports, result details, internal file paths, error information, credentials, personal information, or other confidential task data.

The protocol does not specify data minimization, secret redaction, file permissions, encryption, retention limits, secure deletion, or restrictions on what may be written to the logs. It also uses attacker-influenced placeholders such as {agent_id} without defining validation or canonicalization requirements. If an implementation inserts this value directly into a filesystem path, improper validation could additionally create a path-traversal or unintended-file-write risk, although no implementation demonstrating that behavior is present in the audited project.

Attack Path

  1. An attacker or untrusted task originator includes a secret or other sensitive content in a task instruction.
  2. The agent handles the message according to the documented communication protocol.
  3. The directive to record all communications causes the sensitive message to be written in plaintext to the dated Markdown log.
  4. The content remains available beyond the original communication or task lifetime.
  5. A later process, administrator, compromised agent, backup reader, or other principal with access to the agent state directory retrieves the retained information.

This exploitation path does not provide code execution or privilege escalat ...[truncated 752 chars]

Remediation
View remediation

Remediation Suggestions

  • Log communication metadata by default, such as message type, timestamp, delivery state, and an opaque correlation identifier, rather than complete message bodies.
  • Apply structured redaction before persistence, covering passwords, API keys, authentication tokens, private keys, session identifiers, personal data, and other configured sensitive patterns.
  • Require explicit configuration or informed consent before storing full task instructions, results, or error payloads.
  • Create log files with restrictive permissions, such as owner-only access, and ensure parent directories cannot be read or modified by unrelated users or agents.
  • Validate {agent_id} against a strict allowlist and reject path separators, traversal sequences, absolute paths, control characters, and symbolic-link redirections.
  • Resolve and verify the final canonical path before writing, ensuring it remains within the intended communications directory.
  • Define short retention periods, automatic rotation, secure deletion procedures, and controls for backups containing communication logs.
  • Encrypt sensitive retained records at rest with keys managed separately from the log directory.
  • Document prohibited log content and provide a mechanism for callers to mark messages or fields as non-persistent.
  • Add tests confirming that secrets are redacted, permissions are restrictive, path components cannot escape the intended directory, and expired records are deleted.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly mandates persistent logging of all agent communications to a root-owned path, but provides no guidance on data minimization, retention limits, access controls, or handling of sensitive content. Because agent messages may contain task details, outputs, or operational context, this creates a meaningful risk of unnecessary sensitive data retention and privileged local exposure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The skill mandates a single language in its natural-language instructions and examples, with no opt-in or alternative language option. Under the stated policy, forcing a specific language without user choice can be a language or locale policy violation unless the constraint is clearly justified.

Content

No source excerpt is available for this finding.