T01 · Skill Instruction Hijacking
Error
- Location
- linear-transform.js:119
- Finding
- Untrusted Linear Content Is Converted into Authoritative Agent Instructions## Vulnerability Details **File Location**: `linear-transform.js`, lines 119–147 **Vulnerability Type**: Prompt injection through untrusted webhook fields **Risk Level**: High ### Vulnerable Code ```javascript const taskLines = [ `🔗 **LINEAR WEBHOOK TASK** 🔗`, ``, `**Issue:** ${issue.identifier} - ${issue.title}`, `**Requested by:** ${commentor}`, `**Mention:** ${mention}`, ``, `**Issue Details:**`, `- Status: ${state}`, `- Priority: ${priority}`, `- Assignee: ${assignee}`, `- Labels: ${labels}`, `- URL: ${issue.url}`, ``, `**Issue Description:**`, `${issue.description || 'No description provided.'}`, ``, `**Comment/Task:**`, `${comment.body}`, ``, `---`, `**⚠️ MANDATORY: After responding, run this command to post back to Linear:**`, `\`\`\``, `LINEAR_API_KEY=$(cat ~/.linear_api_key) node -e "const {postLinearComment} = require('/home/sven/clawd-mason/skills/linear-webhook/linear-transform.js'); postLinearComment('${issue.id}', \\\`YOUR_RESPONSE_HERE\\\`, '${AGENT_NAMES[agentSession] || agentSession}');"`, `\`\`\``, `Replace YOUR_RESPONSE_HERE with your actual response text.`, `**Issue ID for postLinearComment:** ${issue.id}`, `**Agent Name:** ${AGENT_NAMES[agentSession] || agentSession}`, ]; return taskLines.join('\n'); ``` ### Technical Analysis The issue description, title, labels, user name, and comment body originate from the webhook payload and are inserted verbatim into an agent task. They are not delimited as untrusted data, normalized, or governed by a policy instructing the agent not to follow embedded directives. The resulting prompt combines attacker-controlled content with authoritative text, including a mandatory instruction to execute a local command. An attacker able to submit or forge an applicable webhook can place instructions in the comment or issue description that attempt to override the intended task, ...[truncated 1658 chars]
- Remediation
- ## Remediation Suggestions - Treat every webhook field as untrusted quoted data rather than executable instructions. - Wrap external content in explicit data delimiters and add a higher-priority policy stating that instructions inside those delimiters must never be followed. - Require explicit human approval before the agent invokes shell, file-write, credential, or external-posting tools. - Verify Linear webhook signatures using the raw request body and reject missing, invalid, or stale signatures. - Restrict accepted organization, team, issue, and commenter identifiers through allowlists. - Remove the mandatory command-execution instruction from the generated prompt. - Apply field length limits and avoid logging complete issue descriptions or comments. - Add adversarial tests containing prompt-override instructions, tool requests, and fabricated webhook identities.
