Back to skill

Security audit

模型消耗统计

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent model-usage reporting purpose, but it asks the agent to enumerate and inspect historical sessions and then share session-derived statistics through Feishu without clear consent, scoping, or minimization controls.

Review this skill carefully before installing. It should be used only where users are comfortable granting access to historical OpenClaw session data and sending usage summaries to Feishu. Prefer requiring explicit session/time-range selection, metadata-only retrieval, redaction of session IDs, and a confirmation step before any Feishu message is sent.

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

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:61
Finding

Overbroad Access to Historical Conversation Data

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 61–69
Vulnerability Type: Excessive retrieval of historical session data
Risk Level: Medium

Vulnerable Code

bash
# 列出所有会话
sessions_list(limit=50)

# 获取会话详情
sessions_history(sessionKey="会话 ID", limit=100)

# 按时间范围筛选
sessions_list(activeMinutes=1440)  # 最近 24 小时
sessions_list(activeMinutes=10080) # 最近 7 天

Technical Analysis

The Skill directs the agent to enumerate up to 50 sessions and retrieve up to 100 historical records from an individual session. Token-usage and cost reporting generally requires aggregate metadata, such as token counts, model identifiers, timestamps, and billing information, rather than complete conversation history.

The instructions do not require explicit user authorization before accessing historical sessions, restrict retrieval to sessions owned or selected by the requesting user, or require metadata-only access. They also provide no procedure for excluding message bodies, secrets, personal information, or other sensitive conversation content from the agent context.

This violates the principle of least privilege because the prescribed data access may exceed what is necessary to calculate usage statistics.

Attack Path

  1. A user or other caller requests a historical model-usage report.
  2. The Skill instructs the agent to call sessions_list(limit=50), enumerating available sessions.
  3. The agent selects session identifiers from the returned collection.
  4. The agent calls sessions_history(sessionKey=..., limit=100) for one or more sessions.
  5. Historical messages and potentially sensitive conversation context are loaded even though aggregate metadata would be sufficient.
  6. The agent processes the retrieved data and may include session identifiers or derived information in a report sent through Feishu.
  7. Sensitive data is consequently exposed to a broader processing and external-delivery scope ...[truncated 842 chars]
Remediation
View remediation

Remediation Suggestions

  1. Use a metadata-only API that returns token counts, model identifiers, timestamps, and costs without returning message bodies.
  2. Remove sessions_history from the default reporting workflow. Invoke it only when aggregate metadata is unavailable and the user has explicitly authorized access to the specified session.
  3. Require users to select the intended sessions and time range instead of enumerating all accessible sessions by default.
  4. Apply minimal result limits and retrieve only fields strictly required for the requested calculation.
  5. Enforce authorization checks so the caller can access only sessions they own or are explicitly permitted to inspect.
  6. Redact or pseudonymize session identifiers before displaying or transmitting reports.
  7. Exclude message bodies, credentials, personal information, tool outputs, and attachments from generated reports.
  8. Require confirmation before sending usage reports to Feishu or any other external destination, and clearly identify the destination and included fields.
  9. Add retention limits and avoid storing retrieved history after the calculation is complete.
  10. Document that historical message access is exceptional and record an audit event whenever such access occurs.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (3)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill instructs sending session-derived usage statistics through Feishu message cards without requiring an explicit user warning, consent step, or data-minimization guidance at the point of transmission. Even if the content is 'only statistics', session IDs, model usage patterns, time ranges, and aggregated activity can still reveal sensitive operational or behavioral information and may be exposed to unintended recipients in external messaging systems.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest description specifies the skill entirely in Chinese and the rest of the instructions and examples are also Chinese-only. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy concern unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest description and skill name are entirely in Chinese, with no indication that users can choose another language or that the skill is intentionally limited to a Chinese-speaking or region-specific context. This can violate a language/locale policy when a skill appears to impose a specific language without opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.