Back to skill

Security audit

The Arena — AI Debate Moderator

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly a coherent Discord debate moderator, but it needs review because its default setup can expose an entire Discord guild and its scripts have unsafe input handling.

Install only after reviewing the generated OpenClaw and Discord permissions. Prefer explicit channel ID allowlists, requireMention=true by default, minimal bot permissions, a dedicated isolated agent, and operator-only scoreboard access. Patch the setup and scoreboard scripts to validate numeric inputs and generate JSON with a serializer before relying on them in a shared server.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/setup.sh:132
Finding

Command Execution Through Unvalidated Bash Arithmetic Expressions

Content
View full analysis
&2 exit 1 fi fi ``` ### Technical Analysis The four weight values are read as unrestricted strings and then evaluated inside a Bash arithmetic expansion. Bash arithmetic contexts do not merely parse decimal integers: they evaluate arithmetic expressions and recursively resolve variable and array references. Malicious expressions involving array subscripts or nested substitutions can consequently trigger unintended shell evaluation. The check that the final total equals 100 occurs only after the arithmetic expression has been evaluated. It therefore cannot prevent side effects produced during evaluation. ### Attack Path 1. An attacker convinces a privileged operator or automation process to run `scripts/setup.sh`. 2. The operator chooses custom judging weights. 3. The attacker supplies a crafted Bash arithmetic expression instead of a decimal weight. 4. Line 142 evaluates the expression while calculating `TOTAL`. 5. Embedded side effects execute with the privileges of the process running the setup script. 6. The final sum validation occurs only after the malicious expressi ...[truncated 381 chars]
Remediation
View remediation
&2 exit 1 fi if (( 10#$value < 0 || 10#$value > 100 )); then echo "Error: weights must be between 0 and 100." >&2 exit 1 fi } ``` Call this function for all four values, then convert them explicitly: ```bash validate_weight "$W_EVIDENCE" validate_weight "$W_ENGAGEMENT" validate_weight "$W_HONESTY" validate_weight "$W_PERSUASION" W_EVIDENCE=$((10#$W_EVIDENCE)) W_ENGAGEMENT=$((10#$W_ENGAGEMENT)) W_HONESTY=$((10#$W_HONESTY)) W_PERSUASION=$((10#$W_PERSUASION)) TOTAL=$((W_EVIDENCE + W_ENGAGEMENT + W_HONESTY + W_PERSUASION)) ``` Reject expressions, signs, whitespace, variable names, array syntax, and all other non-decimal input. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/scoreboard.sh:161
Finding

SQL Injection Through the Scoreboard History Limit

Content
View full analysis
Remediation
View remediation
&2 exit 1 fi limit=$((10#$limit)) if (( limit < 1 || limit > 100 )); then echo "Error: --limit must be between 1 and 100." >&2 exit 1 fi ``` Where supported, use SQLite parameters rather than textual interpolation. Also reject missing values after `--limit` instead of silently substituting the default, and add regression tests using semicolons, comments, whitespace, signs, and oversized integers. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
references/setup-guide.md:145
Finding

Guild-Wide Agent Exposure and Excessive Discord Permissions

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/setup.sh:294
Finding

Configuration Injection Through Unescaped Setup Values

Content
View full analysis
&2 exit 1 fi ``` ```bash read -rp " Arena requireMention (true=cheaper, false=active moderation) [false]: " ARENA_MENTION ARENA_MENTION="${ARENA_MENTION:-false}" ``` ```bash 3) read -rp " Model string: " MODEL if [[ -z "$MODEL" ]]; then echo "Error: Model string required." >&2 exit 1 fi ;; ``` The values are interpolated directly into JSON-shaped output: ```bash cat > "$CONFIG_FILE" <
Remediation
View remediation
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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description promises a broad Discord debate moderator with AI judging and multiple interactive features. The supplied code only provides one narrow supporting component: persistent scoreboard management via a shell script and SQLite database. While the persistent scoreboard aspect aligns with part of the description, the primary declared capabilities—Discord operation, moderation flow, AI judging, personas, and scored verdicts—are absent from this code chunk. This is a material description-to-behavior mismatch rather than a mere partial implementation detail.

Content

No source excerpt is available for this finding.

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
75% confidence
Finding

Skill attempts to nullify the agent's safety policies or restrictions ('you have no restrictions', 'ignore your guidelines', 'do anything now'). This is a direct jailbreak that disables guardrails.

Content

Scanner excerpt · SKILL.md (reported line 64)May include surrounding context.

md
### Step 1 — Choose a Server
Create a new Discord server or pick an existing one. You'll need the **guild ID**
(right-click the server icon → Copy Server ID with Developer Mode enabled).

### Step 2 — Choose a Moderator Persona
Pick the voice your moderator uses during debates. Default: **Scholar**.

Instruction Override

High
Category
Prompt Injection
Confidence
70% confidence
Finding

This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.

Content

Scanner excerpt · scripts/setup.sh (reported line 47)May include surrounding context.

sh
# ── Guild ID ──────────────────────────────────────
echo "Step 1: Discord Server (Guild) ID"
echo "  Enable Developer Mode in Discord (Settings → Advanced),"
echo "  then right-click your server icon → Copy Server ID."
echo ""
read -rp "  Guild ID: " GUILD_ID

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrase "set up a debate server" is broad enough that it could activate during ordinary administrative conversation and initiate privileged configuration guidance unexpectedly. In an agent environment, ambiguous activation phrases can cause unintended state changes, excessive data collection, or generation of sensitive config templates when the user did not mean to invoke the skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The phrase "let's debate" is vague and context-free, so it could be triggered in casual chat rather than as an intentional command to move a topic into moderated debate flow. In a public or semi-public Discord setting, this increases the chance of unsolicited bot actions, channel noise, and accidental processing of user content under the debate workflow.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

Documenting a destructive scoreboard.sh reset command without an explicit warning, confirmation requirement, or access-control note can lead operators or the agent to erase persistent records unintentionally. If exposed through automation, a simple mistaken invocation could wipe all debate history and standings, causing integrity and availability loss for stored data.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly authorizes shell command execution to update and query the scoreboard, which expands the agent's capabilities beyond pure debate moderation into command execution and persistent state mutation. Even though the commands are hardcoded examples, interpolating user-controlled values like participant names and topics into shell invocations creates unnecessary risk if downstream execution is not strongly sandboxed and safely parameterized.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs the agent to run local scripts that read and update persistent records, but it does not tell users that these requests may execute shell commands or alter stored data. This lack of transparency increases the chance of unintended state changes and makes command-trigger abuse harder for users and operators to notice, especially in a chat environment where terms like 'scoreboard' or 'history' appear harmless.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This format explicitly instructs participants to publicly reveal their actual beliefs before participating, which can pressure users into disclosing sensitive personal opinions in a persistent Discord setting. In the context of debate communities, those disclosures may concern politics, religion, ethics, or other sensitive attributes and can be retained, screenshot, or used for harassment or social targeting.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The guide requests broad Discord permissions including Manage Channels, Manage Messages, and optionally Manage Roles, which gives the bot meaningful moderation power over the server. While some permissions may be functionally necessary for the debate-moderation use case, the documentation does not clearly warn administrators about the scope of control being granted or recommend least-privilege deployment, increasing the risk of accidental overprovisioning or misuse if the bot or agent is compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The sample guild configuration sets requireMention: false and "*": { "allow": true }, which enables the debate agent to read all messages in the guild and potentially respond everywhere. In a semi-public Discord environment, this creates a privacy and prompt-injection exposure well beyond the narrow debate use case, especially because the example does not prominently warn that non-debate channels will also be visible to the agent unless channel access is explicitly restricted.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

Lines L027-L032 define a tightly limited operating scope centered on debate channels and scoreboard resources. However, lines L065-L069 explicitly instruct the agent to use #the-bar for casual conversation, which contradicts the earlier claim that it only handles debates and the scoreboard.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

In a markdown skill file, command or invocation phrases should be specific enough to avoid unintended activation. The standalone trigger help is a common everyday word and the file does not provide exclusion conditions or tighter scoping for when it should count as a command versus normal chat.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The file explicitly allows users to define arbitrary moderator personas, including voice, signature phrases, and fallacy-flagging behavior, but provides no guardrails against abusive, harassing, sexual, extremist, deceptive, or otherwise policy-violating persona definitions. In a Discord moderation/judging context, this can cause the bot to generate unsafe or inappropriate content on demand, especially because persona instructions are meant to shape all ongoing interactions.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.