Back to skill

Security audit

Responsive Agent

Security checks for vulnerabilities and agentic risk

Overview

This skill needs review because it can silently run broad background agent work and keep detailed persistent logs that may expose sensitive information.

Install only if you are comfortable with the agent running user-requested work in background subagents. Avoid using it around secrets or private command output unless logs are redacted and retention is bounded, and require numeric validation for rate-limit wait values before any shell command is run.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:903
Finding

Unvalidated Rate-Limit Values Interpolated into Shell Commands

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 903–930
Vulnerability Type: Command injection through unsafe shell interpolation
Risk Level: High

Vulnerable code:

text
### Template: ClawHub Rate-Limit Wait
When ClawHub returns 429 Too Many Requests:

sessions_spawn(
  task="Install or publish skill to ClawHub, handling rate limits. If 429 received, wait Retry-After seconds then retry. Max 3 attempts.",
  label="clawhub-ops"
)

Inside the subagent:
1. First attempt: run clawhub command
2. If 429: extract Retry-After header (e.g., 60 seconds)
3. exec(command="sleep {Retry-After}", yieldMs={Retry-After * 1000 + 1000}, timeout={Retry-After + 10})
4. Second attempt: retry the clawhub command
5. If still 429 after 3 attempts: write error.md, reply to parent with failure

### Template: GitHub Rate-Limit Wait
When GitHub API returns 403 with "rate limit exceeded":

sessions_spawn(
  task="GitHub API operation, handle rate limits. If 403 received, wait suggested reset time then retry. Max 3 attempts.",
  label="github-ops"
)

Inside the subagent:
1. Check for X-RateLimit-Reset header
2. Calculate wait time: (reset_timestamp - now) + 5 seconds buffer
3. exec(command="sleep {wait_seconds}", yieldMs={wait_seconds * 1000 + 1000}, timeout={wait_seconds + 30})
4. Retry with Authorization header using token from TOOLS.md

Technical Analysis

The Skill instructs an agent to extract values from remote HTTP response headers and interpolate them directly into command strings. It does not require strict numeric parsing, range validation, shell escaping, or argument-array execution.

If an implementation passes the resulting string to a shell, metacharacters embedded in an attacker-influenced value can terminate or extend the intended sleep command. Arithmetic fields such as yieldMs and timeout do not mitigate injection into the separate command string.

The GitHub template ...[truncated 1322 chars]

Remediation
View remediation

Remediation Suggestions

  1. Parse rate-limit values as base-10 integers and reject values containing anything other than the expected numeric syntax.
  2. Enforce a conservative range, such as 0 <= wait_seconds <= configured_maximum.
  3. For date-based headers, use a trusted date parser and calculate the delay internally rather than evaluating header text.
  4. Execute sleep with an argument-array API, such as ["sleep", str(wait_seconds)], without invoking a shell.
  5. Do not construct yieldMs or timeout until numeric validation succeeds.
  6. Treat missing, negative, overflowing, malformed, or excessively large values as errors and apply a fixed safe fallback.
  7. Add tests covering shell metacharacters, whitespace, negative numbers, decimal values, integer overflow, and excessive delays.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:320
Finding

Persistent Error and Memory Logs May Store Sensitive Data Without Redaction

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 320–361
Vulnerability Type: Plaintext sensitive-data retention in workspace files
Risk Level: Medium

Vulnerable code:

text
When an exec call fails inside a subagent:

1. **Log the error** — capture stdout, stderr, exit code
2. **Create directory** — `mkdir -p workspace/tasks/{task-id}` (subagent's responsibility)
3. **Write error file** — `workspace/tasks/{task-id}/error.md`
4. **Reply to parent** — always report back to main process, even on failure

**Error file format** (`workspace/tasks/{task-id}/error.md`):
```markdown
# Subagent Error Report

- Task: [task description]
- Timestamp: [ISO timestamp]
- Exit code: [N or "signal"]
- Command: [what was run]

## stdout
[output]

## stderr
[error output]

## Analysis
[brief root cause if known]

Key principles:

  • No automatic retry (fail-fast per ClawFlow principle)
  • Subagent never silently dies — always replies to parent
  • Main process decides whether to respawn or report failure to user

error.md cleanup strategy:

  • error.md files are persistent audit trail — do NOT auto-delete
  • They serve as historical record of what went wrong
  • Trigger: during weekly memory maintenance (HEARTBEAT.md check)
  • Who: main process runs the scan during HEARTBEAT
  • Script:
    1. Scan workspace/tasks/*/error.md
    2. If file age > 30 days AND task is resolved: move to workspace/tasks/archive/{year}/{task-id}/error.md
    3. If total tasks/ directory > 1GB: report to user "tasks/ directory exceeds 1GB; manual cleanup is recommended"
  • This is NOT automatic deletion — archive only, never delete
text

Related persistent-memory instructions also appear at `SKILL.md:735–775`:

```text
**After subagent completes:** if the task resulted in a **decision, config change, or state change**, update `MEMORY.md`.

Routine subagent work should be logged in 
...[truncated 2163 chars]
Remediation
View remediation

Remediation Suggestions

  1. Redact credentials, authorization headers, cookies, private keys, connection strings, and known secret formats before writing commands or output.
  2. Avoid storing complete command lines; record a sanitized command name and non-sensitive diagnostic summary instead.
  3. Capture only the minimum stdout and stderr required for diagnosis, with truncation and allowlisted fields.
  4. Create directories and files with owner-only permissions, such as directory mode 0700 and file mode 0600.
  5. Define a bounded retention period and securely delete expired records rather than retaining them forever.
  6. Require explicit user approval before persisting output from tasks involving credentials, private communications, or regulated data.
  7. Apply the same redaction and retention rules to MEMORY.md, daily logs, result files, cancellation logs, and archived records.
  8. Prevent secrets from entering command arguments by using environment-variable or secure credential-provider mechanisms, while ensuring those values are also excluded from diagnostics.
  9. Document who can access the workspace and exclude sensitive logs from source control, synchronization, and unencrypted backups.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • 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
Findings (5)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document instructs the agent to reply with a fixed Chinese phrase when the queue limit is exceeded. This is a natural-language locale policy constraint that does not provide user opt-in or indicate that the skill is region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

These lines prescribe specific Chinese phrases for high-priority and queued-task notifications, triggered by user input, but do not offer locale selection. That forces a language choice on all users regardless of their preferred language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The instruction hard-codes a Chinese reply for spawn failures. Because the skill is not documented as China-specific and does not allow user language choice, this violates the language/locale policy described in SQP-3.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill specifies exact Chinese confirmation text for stop actions. This is a natural-language policy issue because it imposes a specific output language without opt-in or an explicit regional scope.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The statement at L1002 says no specific service names or AI names appear in any example, but earlier examples explicitly mention ClawHub and GitHub. This is an active contradiction between the documentation claim and the actual content of the file, even though the impact is limited.

Content

No source excerpt is available for this finding.