Back to skill

Security audit

glm-plan-usage

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to query GLM usage as advertised, but its optional hourly cron setup and API-key handling deserve review before installation.

Run the script on demand unless you specifically want continuous monitoring. If you enable the cron example, understand it will keep running every hour, reading your GLM API key and writing a local usage log; document how to remove that cron entry and protect or rotate the API key if needed.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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)

T06 · System Persistence

Warning
Location
docs/INSTALLATION.md:289
Finding

Optional Cron Configuration Creates Persistent Hourly Execution

Content
View full analysis

Vulnerability Details

File Location: docs/INSTALLATION.md, lines 289–293; duplicated in the translated section at lines 524–528
Vulnerability Type: Unnecessary scheduled-task persistence
Risk Level: Medium

bash
# Check usage every hour
crontab -e
# Add: 0 * * * * bash ~/.openclaw/skills/glm-plan-usage/scripts/query-usage.sh >> ~/.glm-usage.log

Technical Analysis

The installation guide recommends adding an hourly cron task that persists beyond the current Skill invocation. Persistent scheduling is not necessary for the Skill's declared on-demand usage-query functionality.

The scheduled command repeatedly executes a mutable script from the user's home directory and appends its output to ~/.glm-usage.log. The documentation does not provide:

  • A retention or rotation policy for the log.
  • Explicit restrictive permissions for the log.
  • Integrity protection or version pinning for the scheduled script.
  • Instructions for removing the cron entry during uninstallation.

Although the cron task is optional and requires explicit user action, it expands the Skill's execution lifetime and attack surface beyond the minimum privileges and persistence needed for an on-demand monitoring tool.

Attack Path

  1. The user follows the optional installation instructions and adds the cron entry.
  2. Cron executes query-usage.sh every hour under the user's account.
  3. A malicious update, compromised installation source, or local attacker modifies the script at the same path.
  4. The modified script is subsequently executed automatically without another explicit Skill invocation.
  5. The replacement code obtains the permissions and accessible resources of the affected user account.
  6. Usage output also continues accumulating in ~/.glm-usage.log, potentially exposing historical account activity to processes or users that can read the file.

Impact Assessment

A successful script replacement could execute arbitrary commands with the privileges o ...[truncated 357 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove the cron recommendation from the default installation process, or place it in a clearly separated, explicit opt-in automation section.
  • Explain that scheduling is unnecessary for normal on-demand operation.
  • Schedule a version-pinned or integrity-verified script rather than an unrestricted mutable path.
  • Create the log with permissions limited to its owner, such as mode 0600.
  • Configure log rotation, a maximum size, and a retention period.
  • Redirect standard error explicitly and define behavior for failed requests.
  • Document how to inspect and remove the installed cron entry during uninstallation.
  • Prefer a platform monitoring mechanism that provides explicit enable, disable, status, and logging controls.

T09 · Insecure Skill Coding Practices

Note
Location
scripts/query-usage.sh:206
Finding

API Credential Is Passed Through the Curl Process Argument Vector

Content
View full analysis

Vulnerability Details

File Location: scripts/query-usage.sh, lines 206–211
Vulnerability Type: Sensitive credential exposure through process arguments
Risk Level: Low

bash
response=$(curl -sS \
    --connect-timeout 10 \
    --max-time 30 \
    -H "Authorization: $API_KEY" \
    -H "Content-Type: application/json" \
    "$url" 2>&1)

Technical Analysis

The Skill reads an API key from ~/.openclaw/openclaw.json and interpolates it directly into a curl header argument. Consequently, the complete authorization header is included in the spawned process's argument vector.

On systems where process metadata is visible to other local users or processes, an observer may inspect the running curl command and recover the API key. Exploitability depends on operating-system process isolation, /proc configuration, account boundaries, and the attacker's existing local permissions.

The credential is sent only to the hardcoded official HTTPS host, https://open.bigmodel.cn, which limits remote credential-redirection risk. Nevertheless, exposing the secret in process arguments is avoidable. The optional hourly cron configuration also creates repeated opportunities to observe the short-lived process.

Attack Path

  1. The Skill extracts the GLM API key from the OpenClaw configuration.
  2. It launches curl with Authorization: $API_KEY as a command-line argument.
  3. While the request is running, a local process with sufficient process-inspection access reads the curl argument vector.
  4. The observer extracts the authorization value.
  5. The recovered key is reused to make authenticated requests to GLM services within the permissions assigned to that credential.

Impact Assessment

An attacker who recovers the key may consume the victim's API quota, query monitoring information, or invoke any other GLM operations authorized for the same credential. The precise scope is limited by the API key's server-side permissions.

This issue ...[truncated 217 chars]

Remediation
View remediation

Remediation Suggestions

  • Avoid placing the authorization value directly in the process argument vector.
  • Supply sensitive headers through a permission-restricted temporary curl configuration or another secret-delivery mechanism that does not expose the key in command arguments.
  • Create any temporary credential material with mode 0600 under a restrictive umask.
  • Register a cleanup trap and securely remove temporary files after the request.
  • Restrict ~/.openclaw/openclaw.json to the owning user and validate its permissions before reading credentials.
  • Use narrowly scoped API keys where supported, and document rotation and revocation procedures.
  • Avoid unnecessary periodic execution so that the number of credential-exposure opportunities is minimized.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (43)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
91% confidence
Finding

This duplicate finding points to the fully matched rm -rf ~/.openclaw/skills/glm-plan-usage command. It is dangerous for the same reason: an irreversible recursive deletion command in docs can be misused or mistyped and cause data loss.

Content

Scanner excerpt · docs/INSTALLATION.md (reported line 257)May include surrounding context.

To remove the skill:

bash
rm -rf ~/.openclaw/skills/glm-plan-usage

To remove only the configuration (keeping other providers):

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
91% confidence
Finding

This duplicate finding points to the fully matched rm -rf ~/.openclaw/skills/glm-plan-usage command. It is dangerous for the same reason: an irreversible recursive deletion command in docs can be misused or mistyped and cause data loss.

Content

Scanner excerpt · docs/INSTALLATION.md (reported line 257)May include surrounding context.

To remove the skill:

bash
rm -rf ~/.openclaw/skills/glm-plan-usage

To remove only the configuration (keeping other providers):

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

This duplicate finding flags the explicit backup deletion command rm -rf ~/.openclaw/skills/glm-plan-usage.bak. Removing a rollback copy without verification is unsafe and can worsen recovery from a bad upgrade.

Content

Scanner excerpt · docs/INSTALLATION.md (reported line 280)May include surrounding context.

chmod +x ~/.openclaw/skills/glm-plan-usage/scripts/query-usage.sh

Remove backup

rm -rf ~/.openclaw/skills/glm-plan-usage.bak

text

## Next Steps

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

This duplicate finding flags the explicit backup deletion command rm -rf ~/.openclaw/skills/glm-plan-usage.bak. Removing a rollback copy without verification is unsafe and can worsen recovery from a bad upgrade.

Content

Scanner excerpt · docs/INSTALLATION.md (reported line 280)May include surrounding context.

chmod +x ~/.openclaw/skills/glm-plan-usage/scripts/query-usage.sh

Remove backup

rm -rf ~/.openclaw/skills/glm-plan-usage.bak

text

## Next Steps

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
91% confidence
Finding

This duplicate finding flags the full Chinese uninstall rm -rf command. The core risk is irreversible deletion from a forceful recursive command in user-facing instructions.

Content

Scanner excerpt · docs/INSTALLATION.md (reported line 498)May include surrounding context.

要移除技能:

bash
rm -rf ~/.openclaw/skills/glm-plan-usage

升级

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
91% confidence
Finding

This duplicate finding flags the full Chinese uninstall rm -rf command. The core risk is irreversible deletion from a forceful recursive command in user-facing instructions.

Content

Scanner excerpt · docs/INSTALLATION.md (reported line 498)May include surrounding context.

要移除技能:

bash
rm -rf ~/.openclaw/skills/glm-plan-usage

升级

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

This duplicate finding flags the full Chinese backup deletion command. It permanently removes the rollback copy and can contribute to unrecoverable loss after upgrade issues.

Content

Scanner excerpt · docs/INSTALLATION.md (reported line 515)May include surrounding context.

chmod +x ~/.openclaw/skills/glm-plan-usage/scripts/query-usage.sh

删除备份

rm -rf ~/.openclaw/skills/glm-plan-usage.bak

text

## 后续步骤

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

This duplicate finding flags the full Chinese backup deletion command. It permanently removes the rollback copy and can contribute to unrecoverable loss after upgrade issues.

Content

Scanner excerpt · docs/INSTALLATION.md (reported line 515)May include surrounding context.

chmod +x ~/.openclaw/skills/glm-plan-usage/scripts/query-usage.sh

删除备份

rm -rf ~/.openclaw/skills/glm-plan-usage.bak

text

## 后续步骤

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The phrase 'Chinese Output' describes a fixed language behavior, and the rest of the README reinforces Chinese-only output examples. This can violate language/locale policy expectations because it imposes a locale preference without explicitly offering the user a choice.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% 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 · README.md (reported line 209)May include surrounding context.

md
Contributions are welcome! Please:

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Submit a pull request

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This line explicitly says the skill provides Chinese output, presenting a fixed locale behavior. Because no nearby documentation offers a language selection or opt-in mechanism, it appears to enforce a specific language/locale.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill documents shell-based execution (bash, curl, jq) but does not declare any tool scope such as permissions or allowed-tools. This creates a capability transparency problem: users and the host may not have an explicit declaration that the skill needs shell access and networked command execution, increasing the chance of overbroad or unintended execution.

Content

No source excerpt is available for this finding.

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 · README.md (reported line 55)May include surrounding context.

Linux (Debian/Ubuntu)

bash
sudo apt-get update
sudo apt-get install -y jq curl

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 · README.md (reported line 148)May include surrounding context.

Linux (Debian/Ubuntu)

bash
sudo apt-get update
sudo apt-get install -y jq curl

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 · README.md (reported line 253)May include surrounding context.

Linux (Debian/Ubuntu)

bash
sudo apt-get update
sudo apt-get install -y jq curl

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 · README.md (reported line 315)May include surrounding context.

Linux (Debian/Ubuntu)

bash
sudo apt-get update
sudo apt-get install -y jq curl

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 · SKILL.md (reported line 47)May include surrounding context.

Linux (Debian/Ubuntu)

bash
sudo apt-get update
sudo apt-get install -y jq curl

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 · SKILL.md (reported line 194)May include surrounding context.

Linux (Debian/Ubuntu)

bash
sudo apt-get update
sudo apt-get install -y jq curl

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 · docs/INSTALLATION.md (reported line 22)May include surrounding context.

Linux (Debian/Ubuntu)

bash
sudo apt-get update
sudo apt-get install -y jq curl

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 · docs/INSTALLATION.md (reported line 23)May include surrounding context.

Linux (Debian/Ubuntu)

bash
sudo apt-get update
sudo apt-get install -y jq curl

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 · docs/INSTALLATION.md (reported line 28)May include surrounding context.

Linux (Debian/Ubuntu)

bash
sudo apt-get update
sudo apt-get install -y jq curl

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 · docs/INSTALLATION.md (reported line 30)May include surrounding context.

Linux (Debian/Ubuntu)

bash
sudo apt-get update
sudo apt-get install -y jq curl

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 · docs/INSTALLATION.md (reported line 313)May include surrounding context.

Linux (Debian/Ubuntu)

bash
sudo apt-get update
sudo apt-get install -y jq curl

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 · docs/INSTALLATION.md (reported line 314)May include surrounding context.

Linux (Debian/Ubuntu)

bash
sudo apt-get update
sudo apt-get install -y jq curl

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 · docs/INSTALLATION.md (reported line 319)May include surrounding context.

Linux (Debian/Ubuntu)

bash
sudo apt-get update
sudo apt-get install -y jq curl