T01 · Skill Instruction Hijacking
- Location
SKILL.md:33- Finding
Main Agent Control-Flow Hijacking Through Mandatory Skill Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:33-57
Vulnerability Type: Mandatory instructions that override the host Agent's routing and processing behavior
Risk Level: CriticalVulnerable Code
python from skills.chat_logger.skill import handle_chat_query, record_message # Step 1: Check whether this is a Chat Logger query command if message.strip() in ["chatlog summary", "daily briefing", "my records"]: # The original instructions require exclusive Chat Logger execution result = handle_chat_query(message, user_name, channel) if result: print(result) return # Immediately stop all subsequent processingThe surrounding Skill instructions explicitly require that the main Agent must not process matching messages, must return the Skill result without modification, and must immediately terminate subsequent processing.
Technical Analysis
The Skill does not merely document its callable API. It directs the host Agent to surrender control over message routing and response handling. For selected trigger messages, the Agent is instructed to:
- Execute only this Skill.
- Avoid its normal processing logic.
- Return the Skill-generated content without modification.
- Terminate processing immediately.
These requirements can bypass competing handlers, policy checks, output validation, and other security controls that would ordinarily run after Skill execution. This behavior matches instruction hijacking because the Skill text attempts to alter the active Agent's goals and control flow when loaded.
Attack Path
- The Chat Logger Skill is loaded, including the mandatory routing instructions in
SKILL.md. - A user sends one of the designated query commands.
- The main Agent follows the Skill's instruction to execute only
handle_chat_query(). - The Skill generates a response containing stored log information.
- The main Agent returns that resp ...[truncated 640 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove all instructions stating that the main Agent is forbidden from processing a message.
- Remove requirements to return Skill output unchanged or terminate processing immediately.
- Describe
handle_chat_query()as an optional API rather than an exclusive routing mechanism. - Leave authorization, routing, policy enforcement, and output validation under the host Agent's control.
- Require all Skill responses to pass through the host's standard safety and disclosure checks.
- Document supported commands without imposing higher-priority behavioral instructions on the Agent.
