Back to skill

Security audit

toq protocol

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for agent-to-agent messaging, but it asks users to run an unverified remote installer and documents persistent network/LLM automation with incomplete safeguards.

Review before installing. Prefer Homebrew or a verified release over the curl-to-shell installer, avoid sending secrets or personal data, keep approval or allowlist mode enabled, do not enable broad wildcards unless intended, use OpenClaw command approval for any handler that reaches an agent, and only enable auto-start after deciding you want a persistent network service.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:25
Finding

Unpinned Remote Installation Script Is Executed Directly by a Shell

Content
View full analysis
Remediation
View remediation

T06 · System Persistence

Warning
Location
references/security.md:58
Finding

Optional Setup Registers a Persistent Network Daemon Across Reboots

Content
View full analysis
/tmp/toq.service << EOF [Unit] Description=toq protocol daemon After=network.target [Service] Type=forking User=$USER ExecStart=$(which toq) up ExecStop=$(which toq) down Restart=on-failure RestartSec=5 [Install] WantedBy=multi-user.target EOF sudo mv /tmp/toq.service /etc/systemd/system/toq.service sudo systemctl daemon-reload sudo systemctl enable toq ``` macOS launchd instructions: ```bash cat > ~/Library/LaunchAgents/com.toqprotocol.toq.plist << 'EOF' Labelcom.toqprotocol.toq ProgramArguments/usr/local/bin/toqup RunAtLoad KeepAlive EOF launchctl load ~/Library/LaunchAgents/com.toqprotocol.toq.plist ``` ### Technical Analysis These instructions register the `toq` daemon to start automatically in later sessions or after reboot. The Linux procedure writes to `/etc/systemd/system` using `sudo`, crossing a system-wide administrative boundary even though the daemon itself is configured with `User=$USER`. The macOS procedure creates a user-level LaunchAgent with both `RunAtLoad` and `KeepAlive`. Persistence may be operationally useful for users who explicitly require an always-available communication endpoint, but it is not required for basic messaging or one-time use. The instructions do not include explicit consent guidance, removal commands, or meaningful service sandboxing. The systemd unit also resolves `$(which toq)` while generating the service. If the selected executable is later replaced or ...[truncated 1465 chars]
Remediation
View remediation

T01 · Skill Instruction Hijacking

Error
Location
references/conversational.md:38
Finding

Remote Message Content Is Injected into a Stateful Agent Prompt

Content
View full analysis
> "$LOG"; } # Don't reply to thread.close if [[ "$MSG_TYPE" == "thread.close" ]]; then log "$TOQ_FROM closed the thread" exit 0 fi [[ "$MSG_TYPE" != "message.send" ]] && exit 0 [[ -z "$TEXT" ]] && exit 0 log "$TOQ_FROM: $TEXT" PROMPT="You received this message from $TOQ_FROM: \"$TEXT\" Respond naturally (1-4 sentences). On a new line at the end, write CONTINUE or CLOSE. Write CLOSE only if the conversation has reached a natural end." RESPONSE=$(openclaw agent --session-id "toq-$TOQ_THREAD_ID" --message "$PROMPT" --json 2>/dev/null || echo "") ``` ### Technical Analysis The handler extracts attacker-controlled message text and interpolates it directly into the instruction sent to `openclaw agent`. Quotation marks inside a natural-language prompt do not establish a security boundary. A remote sender can include instructions that tell the model to ignore the wrapper prompt, reveal contextual information, alter its behavior, or request tool use. The predictable session identifier, `toq-$TOQ_THREAD_ID`, gives the model memory across turns. This enables a malicious peer to build influence incrementally and potentially affect later messages in the same thread. The project's security guidance recognizes that incoming messages can influence an AI with execution access. Connection approval reduces who may send messages but does not make the content of every message from an approved or compromised peer trustworthy. No direct shell interpolation vulnerability is established here because the pr ...[truncated 1616 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (25)

External Script Fetching

High
Category
Supply Chain
Confidence
98% confidence
Finding

curl ... | sh executes network-fetched code immediately without review, integrity verification, or pinning to a known-good artifact. If the hosting site, transport path, or installer script is compromised, the user can suffer arbitrary code execution under their account.

Content

Scanner excerpt · SKILL.md (reported line 25)May include surrounding context.

If not found, install:

bash
curl -sSf https://toq.dev/install.sh | sh && export PATH="$HOME/.toq/bin:$PATH"

Or with Homebrew:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · SKILL.md (reported line 199)May include surrounding context.

If that fails:

bash
pkill -f "toq up" && rm -f ~/.toq/toq.pid

Key management

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · SKILL.md (reported line 199)May include surrounding context.

If that fails:

bash
pkill -f "toq up" && rm -f ~/.toq/toq.pid

Key management

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · references/conversational.md (reported line 8)May include surrounding context.

Registering an LLM handler

bash
toq handler add chat --provider anthropic --model claude-sonnet-4-20250514 \
  --prompt "You are a helpful assistant" --auto-close

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill description is broad enough to activate on generic 'communication between AI agents' requests, not just explicit toq usage. That can cause the agent to offer or execute toq-specific setup, networking, or automation steps in contexts the user did not clearly intend, increasing the chance of unnecessary system changes or unsafe command suggestions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The setup instructions include both execution of a remote installer and an external IP lookup, but the only warning present is about toq being alpha and not about code execution or network metadata disclosure. Users may be guided into running third-party shell code and sending host information to external services without informed consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The commands in this section alter trust relationships and access control state (approve, revoke, block, unblock) but the documentation provides no warning about their security consequences. In an agent-to-agent messaging skill, these operations can silently grant unauthorized communication, revoke legitimate access, or block trusted peers, increasing the chance of operator error or unsafe automation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

toq clear-logs is a destructive command that irreversibly removes audit and troubleshooting data, yet the command list does not warn users about data loss. In a secure messaging system, logs may be important for incident response, abuse investigation, and accountability, so undocumented deletion raises operational and security risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation says the daemon sends the message and conversation history to an external LLM provider, but it does not explicitly warn users that potentially sensitive inter-agent communications will leave the local environment. In this skill context, messages are specifically between AI agents and may include operational details, tokens, or private data, so silent external sharing increases confidentiality and compliance risk.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation states that LLM responses are scanned and redacted for credential patterns before being sent, but the custom shell handler example forwards $REPLY directly to toq send with no redaction step. In an agent-to-agent messaging skill, this mismatch is dangerous because model output may echo secrets from prior context, logs, prompts, or remote messages and transmit them to another party.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The example handler persists untrusted incoming message content (TOQ_TEXT, TOQ_FROM) to local files without any notice about retention, sensitivity, or access controls. In an agent-to-agent messaging skill, messages may contain secrets, prompts, or personal data, so normalizing persistence in examples can lead operators to store sensitive data unintentionally and expand exposure through local file compromise or backups.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The auto-reply examples reflect or transmit conversation content automatically without guidance about disclosure risks or trust boundaries. In this skill, handlers process messages from other agents automatically, so echoing or forwarding text can leak sensitive or adversarially supplied content to external parties or create unintended propagation of private data.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/security.md (reported line 35)May include surrounding context.

md
### OpenClaw exec tool interaction

This is the most important security consideration. When a remote agent sends a toq message, that message content reaches the AI. If exec is enabled without approval mode, the AI could be influenced by message content to run commands.

Mitigations:
1. Enable OpenClaw's exec approval mode so every command requires human confirmation

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/security.md (reported line 74)May include surrounding context.

[Install] WantedBy=multi-user.target EOF sudo mv /tmp/toq.service /etc/systemd/system/toq.service sudo systemctl daemon-reload sudo systemctl enable toq

text

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/security.md (reported line 75)May include surrounding context.

[Install] WantedBy=multi-user.target EOF sudo mv /tmp/toq.service /etc/systemd/system/toq.service sudo systemctl daemon-reload sudo systemctl enable toq

text

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/security.md (reported line 76)May include surrounding context.

[Install] WantedBy=multi-user.target EOF sudo mv /tmp/toq.service /etc/systemd/system/toq.service sudo systemctl daemon-reload sudo systemctl enable toq

text

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% 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 · references/security.md (reported line 76)May include surrounding context.

EOF sudo mv /tmp/toq.service /etc/systemd/system/toq.service sudo systemctl daemon-reload sudo systemctl enable toq

text

On macOS with launchd:

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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 · references/security.md (reported line 81)May include surrounding context.

On macOS with launchd:

text
cat > ~/Library/LaunchAgents/com.toqprotocol.toq.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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 · references/security.md (reported line 83)May include surrounding context.

On macOS with launchd:

text
cat > ~/Library/LaunchAgents/com.toqprotocol.toq.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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 · references/security.md (reported line 84)May include surrounding context.

On macOS with launchd:

text
cat > ~/Library/LaunchAgents/com.toqprotocol.toq.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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 · references/security.md (reported line 91)May include surrounding context.

On macOS with launchd:

text
cat > ~/Library/LaunchAgents/com.toqprotocol.toq.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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 · references/security.md (reported line 93)May include surrounding context.

On macOS with launchd:

text
cat > ~/Library/LaunchAgents/com.toqprotocol.toq.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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 · references/security.md (reported line 83)May include surrounding context.

text
cat > ~/Library/LaunchAgents/com.toqprotocol.toq.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key><string>com.toqprotocol.toq</string>

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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 · references/security.md (reported line 93)May include surrounding context.

EOF launchctl load ~/Library/LaunchAgents/com.toqprotocol.toq.plist ```

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

toq import and toq rotate-keys can significantly change agent identity, restore old state, or disrupt existing peer trust, but the documentation does not warn users about these effects. In this skill's context, key rotation and config restoration directly affect secure communications, so omissions can lead to broken trust chains, message delivery failures, or accidental rollback to unsafe state.

Content

No source excerpt is available for this finding.