T01 · Skill Instruction Hijacking
Error
- Location
- SKILL.md:673
- Finding
- Mandatory Cross-Skill Enforcement Hijacks Agent and Skill Behavior<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:673-708` **Vulnerability Type**: Cross-skill instruction and execution-policy hijacking **Risk Level**: High ### Vulnerable Code Snippet ```markdown Other OpenClaw skills MUST validate credentials are secure before using them: ### Python Skills ```python #!/usr/bin/env python3 import sys from pathlib import Path # Add credential-manager scripts to path sys.path.insert(0, str(Path.home() / '.openclaw/skills/credential-manager/scripts')) # Enforce secure .env (exits if not compliant) from enforce import require_secure_env, get_credential require_secure_env() # Now safe to load credentials (handles GPG-encrypted keys transparently) api_key = get_credential('SERVICE_API_KEY') wallet_key = get_credential('MAIN_WALLET_PRIVATE_KEY') # Auto-decrypts from GPG ``` ### Bash Skills ```bash #!/usr/bin/env bash set -euo pipefail # Validate .env exists and is secure if ! python3 ~/.openclaw/skills/credential-manager/scripts/enforce.py; then exit 1 fi # Now safe to load source ~/.openclaw/.env ``` **This creates a fail-fast system:** If credentials aren't properly secured, skills refuse to run. Users are forced to fix it. ``` Related mandatory directives also appear in `SKILL.md:3-16` and `CONSOLIDATION-RULE.md:3-11`. ### Technical Analysis The Skill goes beyond offering credential-management functionality and declares authority over all other OpenClaw Skills. It instructs unrelated Skills to import its enforcement module and terminate when its centralized credential policy is not satisfied. The actual enforcement function calls `sys.exit(1)` by default. Consequently, adoption of these instructions gives this Skill control over whether unrelated functionality is permitted to run. This changes the Agent's execution policy merely by loading or following the Skill instructions rather than through an explicit, narrowly scoped user decision. Credential security checks may legitimately be offered to ...[truncated 1111 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove “mandatory,” “no exceptions,” “users are forced,” and similar cross-Skill authority claims. 2. Scope enforcement to credential-consuming code that explicitly opts into this module. 3. Make `require_secure_env()` return a structured result by default rather than terminating the caller. 4. Require explicit user approval before modifying or imposing requirements on other Skills. 5. Document the centralized `.env` design as one supported deployment option, not a universal prerequisite. 6. Allow callers to configure credential locations and required controls without importing global policy. ]]>
