Back to skill

Security audit

Create Educational Subagent

Security checks for vulnerabilities and agentic risk

Overview

The skill is for creating a course-progress tracking sub-agent, but it also grants broad OpenClaw admin, approval, pairing, write, and secrets-related permissions without enough review.

Review carefully before installing. Do not run the permission approval script or approve broad OpenClaw scopes unless you have independently inspected the exact pending request and truly need those privileges. A course-progress sub-agent should not normally need admin, pairing, approvals, write, or secrets-related access.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (2)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/approve_permissions.sh:3
Finding

Unverified Approval of Broad Privilege Requests

Content
View full analysis

Vulnerability Details

File Location: scripts/approve_permissions.sh:3; also documented in SKILL.md:25-27, 82, 87-89
Vulnerability Type: Unverified permission approval and excessive privilege escalation
Risk Level: High

Vulnerable Code:

bash
openclaw devices approve --latest

The associated documentation states that the approved request may receive the following scopes:

text
operator.read
operator.admin
operator.write
operator.approvals
operator.pairing
operator.talk.secrets

Technical Analysis

The script approves the newest pending device permission request without validating the request ID, device ID, requester identity, requested scopes, or intended agent. The meaning of --latest depends on mutable global request ordering rather than a trusted identifier.

This creates a time-of-check/time-of-use and request-substitution risk. An attacker capable of submitting a permission request can attempt to make their request the latest immediately before the script is executed. The script would then approve the attacker's request instead of the request expected by the user.

The documented permission set also violates least privilege for an educational progress-recording agent. Administrative access, permission-approval authority, device pairing, write access, and secret-related communication are not demonstrated as necessary for the stated task.

Attack Path

  1. An attacker submits a device permission or privilege-escalation request to the same OpenClaw environment.
  2. The attacker times the submission so that it becomes the newest pending request.
  3. A user follows the Skill instructions or executes scripts/approve_permissions.sh.
  4. openclaw devices approve --latest resolves to the attacker-controlled request.
  5. The request is approved without displaying or validating its identity and scopes.
  6. The attacker uses the granted capabilities to administer the enviro ...[truncated 685 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the unconditional --latest approval operation.
  2. List pending requests and display each request's ID, device identity, requester, origin, requested scopes, and creation time.
  3. Require the user to select and confirm an exact request ID.
  4. Verify that the request belongs to the expected device and workflow before approval.
  5. Reject unexpected or stale requests and fail closed if identity verification cannot be completed.
  6. Grant only the minimum scopes required to spawn and operate the educational subagent.
  7. Exclude administrative, approval, pairing, and secret-related scopes unless each scope has a documented and unavoidable requirement.
  8. Record approval decisions in an audit log and warn the user before granting high-impact scopes.
  9. Prefer a command pattern equivalent to:
    bash
    request_id=${1:?Usage: approve_permissions.sh REQUEST_ID}
    openclaw devices show-request "$request_id"
    # Continue only after explicit identity and scope confirmation.
    openclaw devices approve "$request_id"
    
    The exact commands should be adjusted to the supported OpenClaw CLI syntax.

T09 · Insecure Skill Coding Practices

Note
Location
scripts/create_educational_subagent.sh:3
Finding

Shell Metacharacters Used in Agent ID Placeholder

Content
View full analysis

Vulnerability Details

File Location: scripts/create_educational_subagent.sh:3
Vulnerability Type: Unsafe shell placeholder and unintended redirection
Risk Level: Low

Vulnerable Code Segment:

bash
openclaw sessions_spawn --runtime acp --agentId <your_agent_id> --label "educational subagent" --mode run --task "..."

The original script uses the literal shell segment:

text
--agentId <your_agent_id>

Technical Analysis

In Bash, angle brackets are input and output redirection operators; they are not safe placeholder delimiters. The shell therefore does not pass the literal placeholder as the value of --agentId.

The opening angle bracket attempts to read standard input from a file named your_agent_id. The closing angle bracket is interpreted as output redirection, with a following token potentially treated as the output filename instead of a command argument. Depending on which redirections succeed, this can cause command failure or unintended filesystem creation or truncation.

The script does not validate that an agent ID was supplied, quote a user-provided value, enable strict error handling, or confirm that the spawn operation succeeded.

Attack Path

  1. A user executes scripts/create_educational_subagent.sh without manually editing the placeholder.
  2. Bash parses the angle brackets as redirection syntax.
  3. The shell attempts to open your_agent_id as an input file and interprets a later token as an output-redirection target.
  4. The intended agent ID is not supplied to openclaw sessions_spawn.
  5. The operation fails or causes unintended filesystem effects if the relevant redirections can be opened.

This issue does not independently demonstrate remote compromise. Its principal effects are unreliable execution, denial of the intended operation, and possible local file creation or truncation under the invoking user's privileges.

Impact Assessment

...[truncated 380 chars]

Remediation
View remediation

Remediation Suggestions

Replace the shell placeholder with a required positional argument or explicitly named option, validate it, and quote it before use:

bash
#!/usr/bin/env bash
set -euo pipefail

agent_id=${1:?Usage: create_educational_subagent.sh AGENT_ID}

if [[ ! "$agent_id" =~ ^[A-Za-z0-9._:-]+$ ]]; then
    printf 'Invalid agent ID.\n' >&2
    exit 2
fi

openclaw sessions_spawn \
    --runtime acp \
    --agentId "$agent_id" \
    --label "educational subagent" \
    --mode run \
    --task "..."

Additionally:

  1. Never represent editable shell placeholders with unquoted angle brackets.
  2. Keep all variable expansions quoted.
  3. Validate the agent ID against the exact format accepted by OpenClaw.
  4. Enable strict shell error handling.
  5. Check and report the command's exit status.
  6. Consider accepting task text from a safely referenced static file to improve maintainability and avoid shell-quoting errors.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a benign educational progress tracker, but its instructions also direct the operator to approve device permissions and manage access-control state. That is a material behavior mismatch because users invoking the skill for recordkeeping would not reasonably expect administrative actions, creating an opportunity for privilege escalation under a misleading label.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest description says the skill should trigger not only for creating a sub-agent to track course progress, but also for '任何涉及长期记录和追踪任务的需求' ('any need involving long-term recording and tracking tasks'). This is far broader than the educational domain and could overlap with many ordinary user requests, causing unintended invocation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill instructs approving broad operator privileges, including admin, approvals, pairing, write, and especially secrets access, which are far beyond what is needed to create or run a course-progress tracking sub-agent. If followed, these steps could grant excessive control over the device and sensitive data, enabling compromise well outside the educational use case.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script unconditionally approves the latest device permission request via openclaw devices approve --latest, which is a sensitive action unrelated to the stated purpose of creating an educational sub-agent for tracking class progress. Because it targets the 'latest' request rather than a specific reviewed request, it can authorize unintended or attacker-triggered access without validation or user awareness.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The title and description are entirely in Chinese and the embedded sub-agent prompt defines a Chinese persona and response pattern, but the file does not state that the user opted into Chinese or that the tool is region-specific. This can violate language/locale policy when a skill implicitly forces one language without user choice.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Although the manifest says the skill creates a teaching-progress sub-agent, the documented workflow centers on resolving failures by changing gateway state and approving escalated permissions. This disconnect can mislead users and reviewers into authorizing sensitive administrative actions under the guise of ordinary educational automation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill includes steps to approve permissions and elevate capabilities without any user-facing warning about the consequences of granting those rights. This is dangerous because operators may execute security-sensitive commands without understanding that they are expanding administrative and secrets-access scope.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The embedded device ID and request ID expose environment-specific identifiers unrelated to the core teaching-progress function. Such details can aid targeting, correlation of approval flows, or unauthorized operational probing if the skill content is shared or logged broadly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This command performs a privileged approval action with no user-facing warning, confirmation, or review step. In the context of an educational tracking skill, silent permission approval is especially dangerous because users would not reasonably expect the skill to modify device-access permissions, increasing the chance of covert privilege escalation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The only natural-language description in the file is a Chinese comment, which imposes a specific language context without offering alternatives or documenting that the skill is intended only for Chinese-speaking users. This may conflict with organizational language or locale policies when no opt-in or justification is provided.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script immediately spawns a new agent session when run, with no user-facing confirmation, dry-run mode, or warning about the side effect. While the task content itself appears administrative and not overtly malicious, automatic agent creation can still surprise users, create unintended persistent processes, or be abused if the script is triggered indirectly in a larger workflow.

Content

No source excerpt is available for this finding.