Back to skill

Security audit

Contract Check

Security checks for vulnerabilities and agentic risk

Overview

This contract-review skill is mostly coherent, but it asks for shell command execution even though it only declares file access.

Review this skill before installing if your environment restricts shell access. It stores your company's contract redlines locally and should be used only if that storage is acceptable. The publisher should replace the `exec` check with a native file read/existence check and clearly state the intended language or locale.

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:8
Finding

Undeclared and Unnecessary Command-Execution Capability

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 8–12 and 20–23
Vulnerability Type: Least-privilege violation through undeclared shell execution
Risk Level: Medium

Vulnerable Code

yaml
metadata:
  permissions:
    - file:read
    - file:write
markdown
1. Use `exec` to check whether the configuration file exists:
   ```bash
   cat ~/.openclaw/workspace/.contract-review-config.json 2>/dev/null || echo "NOT_FOUND"
text

### Technical Analysis

The Skill declares only file-read and file-write permissions, but its mandatory initialization gate explicitly directs the Agent to invoke the general-purpose `exec` capability. Checking whether a fixed configuration file exists and reading its contents can be performed with a file API, so shell execution is unnecessary for the stated function.

This creates a mismatch between the advertised permission boundary and the actual capability requested during operation. A user or policy engine relying on the metadata could authorize the Skill believing it only accesses files, while the runtime instructions cause it to enter a substantially broader command-execution channel.

The reviewed command is static and does not interpolate user-controlled input. Therefore, the current package does not contain a confirmed command-injection primitive or a path to arbitrary attacker-selected command execution. The vulnerability is the undeclared and excessive capability itself.

### Attack Path

1. A user invokes the Skill to review a contract.
2. The mandatory initialization gate instructs the Agent to use `exec`.
3. The Agent requests or exercises shell execution despite the Skill declaring only file-read and file-write permissions.
4. The fixed `cat` command reads the configuration file and suppresses errors.
5. No further privilege escalation is demonstrated by the reviewed content; exploitation beyond obtaining an unnecessarily broad execution channel would require an additional weakness or poli
...[truncated 641 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace the exec command with the platform’s native file-read or file-existence API.
  2. Treat a file-not-found result from that API as the trigger for initialization.
  3. Keep the configuration path fixed and normalized; do not construct it from contract content or other untrusted input.
  4. If shell execution is genuinely required, explicitly declare the corresponding permission in the Skill metadata and document why file APIs are insufficient.
  5. Where supported, constrain execution with an allowlist limited to the required operation rather than granting unrestricted shell access.
  6. Add a validation test that compares all tools used by Skill instructions against the permissions declared in metadata.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description and the entire user-facing workflow are written as mandatory Chinese instructions, with no indication that users may choose another language. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless the locale constraint is explicitly justified, which it is not here.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

This duplicate finding points to the same persistent write capability and associated retention of contract-review policy data. In a contract-review skill, persistence is somewhat justified for user convenience, but it remains security-relevant because the saved configuration can expose business red lines and alter future review outcomes if modified unexpectedly.

Content

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

md
metadata:
  permissions:
    - file:read
    - file:write
  behavior:
    network: none
    telemetry: none

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

This duplicate finding points to the same persistent write capability and associated retention of contract-review policy data. In a contract-review skill, persistence is somewhat justified for user convenience, but it remains security-relevant because the saved configuration can expose business red lines and alter future review outcomes if modified unexpectedly.

Content

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

md
metadata:
  permissions:
    - file:read
    - file:write
  behavior:
    network: none
    telemetry: none

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill directs the agent to invoke a shell command via exec to check for a config file, even though the same goal can be achieved through safer native file APIs already implied by the skill's file permissions. Introducing shell execution expands the attack surface unnecessarily and can normalize command execution patterns in a skill whose purpose is document review, increasing the risk of command injection or unsafe future modifications.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill content is entirely in Chinese and immediately directs the interaction flow without offering any language selection or fallback. This can exclude or confuse users who do not read Chinese, causing them to misconfigure business redlines or provide incorrect answers, which is especially risky in a contract-review skill where configuration errors can materially affect legal risk assessment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents the entire skill guidance exclusively in Chinese and does not offer any language choice, opt-in, or note that the skill is intentionally limited to a Chinese-speaking or China-specific audience. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The manifest frames the skill primarily as contract review and risk detection, with initialization as a prerequisite. The file, however, defines a substantial interactive configuration workflow that collects enterprise policy data and persists a multi-section business-rules profile, which is broader than straightforward contract auditing behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

该 markdown 文件的标题与全文均以中文编写,未说明是否支持其他语言或允许用户选择语言。根据规则,若技能强制特定语言且没有用户选择或明确的区域性正当说明,可视为自然语言层面的语言/locale 政策问题。

Content

No source excerpt is available for this finding.