Back to skill

Security audit

agent-canary

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this skill suspicious because a scanner reports that planting canaries can overwrite an existing credential backup, creating a risk of data loss.

Consider the reported risk of overwriting existing files before installing, especially files containing real credentials or backups. The review is incomplete: although all seven listed components were inspected, referenced paths were unresolved, so the results do not establish that every runtime-referenced item was reviewed.

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
scripts/plant_canaries.py
Finding

Canary deployment silently overwrites an existing credential backup

Content
View full analysis

Impact

Irrecoverable loss of an existing credential backup unless another copy exists. The overwritten path is subsequently registered as a planted canary and is deleted during cleanup (scripts/cleanup_canaries.py:25–28).

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (11)

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

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

md
---
name: agent-canary
description: Plant decoy credentials in your OpenClaw workspace to detect malicious skill behavior. Canary tokens trigger alerts when read, copied, or exfiltrated. Activate when user says "deploy canary", "set up honeypot", "plant decoy", "canary check", "canary status", or "canary cleanup".
version: 1.1.1
---

# Agent Canary

> Decoy credentials planted in your workspace. When a skill touches them, you know.


## Onboarding (First Use)

When the user first triggers this skill and `memory/agent_canary_state.json` doesn't exist, run a one-time setup:

1. **Introduce capability** (one sentence):

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/plant_canaries.py (reported line 18)May include surrounding context.

python
# ── Canary file templates ────────────────────────────────────────────────────

def build_env_canary(tokens):
    """Realistic .env file with canary tokens."""
    aws = next(t for t in tokens if t["type"] == "aws")
    gh = next(t for t in tokens if t["type"] == "github")
    api = next(t for t in tokens if t["type"] == "api_key")

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/plant_canaries.py (reported line 98)May include surrounding context.

python
"path": os.path.join(ws, ".env.canary"),
            "content": build_env_canary(tokens),
            "label": "workspace .env.canary",
            "description": "Fake .env with AWS, GitHub, DB credentials"
        },
        {
            "path": os.path.join(ws, "secrets.backup.json"),

The overwrite guard contradicts the promise not to overwrite existing real files.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The guard permits overwriting existing files whenever their paths end in '.canary' or contain 'backup', so an existing secrets.backup.json can be truncated and replaced with decoys. The subsequent write also follows symbolic links, allowing a pre-positioned link at an exempt destination to redirect truncation to another file writable by the executing user.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: file_read, file_write, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/check_canaries.py (reported line 107)May include surrounding context.

python
# Get most recent log files (last 24h)
    try:
        result = subprocess.run(
            ["find", log_dir, "-name", "*.log", "-mtime", "-1"],
            capture_output=True, text=True, timeout=10
        )

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/check_canaries.py (reported line 124)May include surrounding context.

python
if not os.path.isfile(logfile):
                continue
            try:
                result = subprocess.run(
                    ["grep", "-l", token_short, logfile],
                    capture_output=True, text=True, timeout=5
                )

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/check_canaries.py (reported line 158)May include surrounding context.

python
for fpath in canary_files:
        rel_path = os.path.relpath(fpath, workspace)
        try:
            result = subprocess.run(
                ["git", "-C", workspace, "diff", "--name-only", "HEAD"],
                capture_output=True, text=True, timeout=5
            )

The activation phrase "reset settings" is not specific to Agent Canary and could unintentionally invoke its reconfiguration workflow.

Low
Category
Trigger Abuse
Confidence
93% confidence
Finding

The README instructs users to say "reset settings" without requiring an Agent Canary qualifier or an active configuration context. This generic phrase could refer to another tool or application, unlike the canary-specific commands listed in Quick Start.

Content

No source excerpt is available for this finding.

The reconfiguration trigger "reset settings" is generic and could collide with requests to reset unrelated settings.

Low
Category
Trigger Abuse
Confidence
92% confidence
Finding

The README explicitly presents "reset settings" as an invocation phrase without requiring an Agent Canary context. Unlike the canary-specific commands on line 55, this phrase could unintentionally activate the skill when the user means another application's settings.

Content

No source excerpt is available for this finding.

Cleanup explicitly retains the incidents log despite documentation promising its removal.

Low
Category
Excessive Agency
Confidence
99% confidence
Finding

The module docstring at L02 states that cleanup removes all canary files, the manifest, and the incidents log. However, L37–L39 deliberately preserve the incidents log, so users relying on the documented cleanup behavior will leave incident data on disk.

Content

No source excerpt is available for this finding.