Back to skill

Security audit

Discord Interactive

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly Discord component documentation, but its handling guidance can let ordinary typed messages be treated like trusted button clicks for restricted or destructive actions.

Review before installing if agents may use this skill for approvals, deletion, deployments, moderation, or other consequential Discord workflows. It should only be used where the platform provides trusted interaction metadata to the agent or where the agent independently verifies the user, channel, original message, action ID, workflow state, and expiry before acting.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T09 · Insecure Skill Coding Practices

Error
Location
references/handling.md:19
Finding
Plain-Text Interaction Spoofing Can Trigger Unauthorized Actions## Vulnerability Details **File Location**: `references/handling.md`, lines 19–29 **Vulnerability Type**: Authorization based on spoofable inbound text **Risk Level**: High ### Vulnerable Code Snippet ```text When a user clicks a button, you simply receive a message like: Clicked "Approve". Respond based on the button label: - If the message says `Clicked "Approve"` → execute the approved action - If the message says `Clicked "Reject"` → cancel the action - If the message says `Selected engineer from "Choose an agent..."` → assign to engineer No parsing of `custom_id` needed. OpenClaw handles all the plumbing. ``` The unsafe execution pattern is reinforced in `references/handling.md`, lines 122–129: ```text 1. **Send** component message with action buttons 2. **Receive** click as inbound message (`Clicked "Yes".`) 3. **Execute** the requested action 4. **Edit** the original message to show the result ``` It is also described in `SKILL.md`, lines 112–119: ```text When a user clicks a button or selects an option, OpenClaw delivers it as a normal inbound message: - Button click → `Clicked "Yes".` - Select → `Selected option_a from "Pick an option".` No special callback handling needed — just read the incoming message text. ``` ### Technical Analysis The Skill instructs an agent to authorize and execute actions by matching ordinary inbound message text against human-readable component labels. The documented logic does not require verification of trusted interaction metadata, such as: - Whether the input originated from an authentic Discord component event - The original message and component identifiers - The identity and authorization of the interacting user - The channel or workflow to which the interaction belongs - A server-generated opaque action identifier or nonce - The current workflow state and interaction expiration time Button labels and generated text such as `Clicked "Approve".` are predictable and can also be supplied as ordinary user- ...[truncated 1771 chars]
Remediation
## Remediation Suggestions 1. **Do not authorize actions from message text alone.** Treat strings such as `Clicked "Approve".` as untrusted user input, not proof of a component interaction. 2. **Require trusted interaction metadata.** Before executing an action, verify: - The platform event is an authentic component interaction - The original message ID and component ID match an outstanding workflow - The initiating Discord user is authorized - The interaction occurred in the expected channel or thread - The action has not expired or already been consumed 3. **Use opaque action identifiers.** Bind each component to a server-generated, unpredictable identifier rather than using its display label as the authorization key. Store the identifier with the expected user, action, resource, message, and expiry. 4. **Enforce authorization at execution time.** `allowedUsers` may remain a user-interface restriction, but the action handler must independently verify the sender before performing privileged operations. 5. **Maintain workflow state.** Record pending interactions and atomically mark single-use actions as consumed to prevent replay, delayed execution, and cross-workflow confusion. 6. **Fail closed.** If trusted metadata is absent, ambiguous, expired, or inconsistent, do not execute the action. Ask the authorized user to initiate a fresh confirmation. 7. **Update the documentation.** Replace the label-only examples with secure examples that explicitly distinguish genuine component events from ordinary messages and demonstrate identity, context, state, and expiry validation.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Behavior Manipulation

Medium
Category
Prompt Injection
Content
## When to Use Components v2

**ALWAYS prefer components over plain text when:**
- You need user confirmation → buttons (Yes/No, Approve/Reject)
- You need user selection → select menus (agents, priorities, options)
- You want structured information display → text blocks + sections + separators
Confidence
70% confidence
Finding
Subtle instructions detected that may alter agent decision-making or introduce hidden biases.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
## Examples

See [references/examples.md](references/examples.md) for complete scenarios:
- Yes/No confirmation
- Agent/option selection
- Status card with actions
- Modal form collection
Confidence
75% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
Complete, ready-to-use examples for common scenarios. All examples use the `message` tool.

## 1. Simple Yes/No Confirmation

```json5
{
Confidence
75% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
This markdown section presents an 'Admin Action Required' workflow with 'Approve Deploy' and 'Reject' buttons, which implies a potentially system-impacting deployment action. The description explains access control but does not warn that approving deployment can affect system integrity or production state.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The information card example displays '_Updated at 2026-03-09 18:00 CST_', which forces a specific timezone/locale representation in natural language. There is no indication that the timezone is user-selectable or justified as region-specific.

Missing User Warnings

Low
Confidence
82% confidence
Finding
This markdown file describes an interactive workflow that deletes old log files after a button click, but it does not include any broader warning about the data-destructive nature of the operation beyond the button text itself. Under the markdown-file criteria, behaviors that affect user data or system integrity should include a clear warning in the skill description.

Static analysis

No suspicious patterns detected.