T01 · Skill Instruction Hijacking
- Location
SKILL.md:10- Finding
Untrusted Role Instructions Can Hijack Agent Behavior
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 10 and 52-56
Vulnerability Type: Dynamic loading and adoption of untrusted instructions
Risk Level: HighVulnerable Code Snippet
The following is a faithful English translation of the relevant source directives:
markdown **The role must be recommended first, and work may begin only after the user confirms. The recommendation step cannot be skipped to produce the result directly.** ### Step 4: Load the role's SOUL.md Based on the user's selection, read the role configuration from `~/.openclaw/agency-agents/[role ID]/SOUL.md`. ### Step 5: Work as the role Follow the loaded role's SOUL.md and complete the work using that role's identity, professional terminology, and communication style.Technical Analysis
The skill requires the agent to read instructions from
SOUL.mdfiles located outside the reviewed skill package and then adopt the selected file's identity, terminology, and behavior. No schema validation, content restrictions, integrity verification, or trust-boundary enforcement is specified for these external files.Consequently, a
SOUL.mdfile is treated as executable agent instruction content rather than untrusted role metadata. Anyone who can create or modify a role file can insert directives unrelated to the role's legitimate presentation settings. When the file is loaded, those directives may alter the agent's active objectives, encourage unsafe tool operations, redirect its response, or attempt to override higher-level constraints.User confirmation of a role does not mitigate this issue because the user confirms only the role selection, not the complete contents or security properties of the corresponding
SOUL.md.Attack Path
- An attacker obtains write access to a directory beneath
~/.openclaw/agency-agents/, whether through another compromised component, an unsafe installation process, or an already writa ...[truncated 1263 chars]
- An attacker obtains write access to a directory beneath
- Remediation
View remediation
Remediation Suggestions
- Treat every external
SOUL.mdfile as untrusted data rather than executable instructions. - Replace free-form Markdown loading with a strict, versioned schema containing only approved fields such as role name, expertise, tone, and vocabulary.
- Reject fields or content that request tool execution, identity-policy changes, secret access, instruction-precedence changes, or unrelated actions.
- Resolve and canonicalize the selected path, then verify that it remains beneath an explicitly approved role directory to prevent path traversal or symbolic-link redirection.
- Maintain an allowlist of approved role IDs rather than constructing file paths directly from dynamic selections.
- Verify role files using signed manifests or trusted cryptographic hashes before loading them.
- Separate persona data from operational instructions and place all permitted behavioral rules in trusted skill code.
- Explicitly state that role metadata cannot override system, developer, safety, or current user instructions.
- Display the validated role metadata to the user before activation and require confirmation if the role requests capabilities beyond stylistic behavior.
- Run the role loader with least privilege and deny role content the ability to invoke tools or access resources directly.
- Treat every external
