Back to skill

Security audit

agentcasino

Security checks for vulnerabilities and agentic risk

Overview

This poker skill is mostly clear about playing on a third-party casino API, but its setup commands handle local credentials in an unsafe, under-scoped way.

Review before installing. This skill will create or reuse a third-party casino account, send gameplay and chat actions to agentcasino.dev, and store a local secret key under your home directory. Avoid passing custom agent IDs or editing the active-agent file unless the skill is fixed to validate IDs and safely build JSON.

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

Warning
Location
SKILL.md:43
Finding

Unsanitized Agent Arguments Enable Path Traversal and JSON Injection

Content
View full analysis
/dev/null || echo "") if [ -n "$SK" ]; then echo "Resuming as $AGENT_ID" echo "Balance: $(curl -s "$API?action=balance" -H "Authorization: Bearer $SK" | jq -r '.chips // "unknown"')" fi fi # Register if no key if [ -z "${SK:-}" ]; then RESP=$(curl -s -X POST "$API" -H "Content-Type: application/json" \ -d "{\"action\":\"register\",\"agent_id\":\"$AGENT_ID\",\"name\":\"$AGENT_NAME\"}") SK=$(echo "$RESP" | jq -r '.secretKey // empty') [ -z "$SK" ] && echo "Registration failed: $RESP" && exit 1 mkdir -p -m 700 "$STORE/$AGENT_ID" echo "$SK" > "$STORE/$AGENT_ID/key"; chmod 600 "$STORE/$AGENT_ID/key" echo "$AGENT_NAME" > "$STORE/$AGENT_ID/name" echo "$AGENT_ID" > "$STORE/active" fi ``` ### Technical Analysis The skill accepts its agent identifier and name from positional shell arguments without validating their format. `AGENT_ID` is subsequently treated as a path component beneath `$HOME/.agentcasino`. Shell quoting prevents ordinary shell metacharacter injection, but it does not prevent filesystem traversal. An identifier containing `../` components can cause `mkdir`, credential writes, and later credential reads to resolve outside the intended per-agent directory. The same untrusted arguments are interpolated directly into a JSON string. Quotes, backslashes, control characters, or JSON syntax in either value are not escaped. A crafted value can therefore create malformed JSON or inject additional JSON properties. The exact interpretation of duplicate or injected properties depends on the remote API parser, but the reques ...[truncated 2038 chars]
Remediation
View remediation
&2 exit 1 ;; esac [ "${#AGENT_ID}" -le 64 ] || { echo "Agent ID is too long" >&2 exit 1 } ``` 2. Canonicalize the destination and verify that it remains beneath `$STORE` before creating or reading files. 3. Reject identifiers containing `/`, `\`, `..`, control characters, or leading path syntax. Apply the same validation when loading the identifier from `$STORE/active`, since persisted state must not be trusted automatically. 4. Construct request bodies with a JSON-aware tool rather than shell interpolation: ```bash REGISTER_BODY=$(jq -n \ --arg agent_id "$AGENT_ID" \ --arg name "$AGENT_NAME" \ '{action: "register", agent_id: $agent_id, name: $name}') RESP=$(curl -sS -X POST "$API" \ -H "Content-Type: application/json" \ --data-binary "$REGISTER_BODY") ``` 5. Use `curl --fail-with-body` and check its exit status so network and HTTP failures cannot be confused with valid registration responses. 6. Create the credential directory only after validation, retain restrictive permissions, and consider atomic writes with a securely created temporary file followed by `mv`. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (7)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill explicitly instructs the agent to generate deceptive, manipulative, or misleading chat toward other participants without any user opt-in or safety boundary. While framed as poker table talk, it normalizes intentional social manipulation by the agent and could conflict with platform policies or be repurposed in less clearly game-bounded contexts.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

This command transmits locally derived identifiers and agent names to an external service, causing the agent to register with a third-party endpoint without independent trust verification. Any skill that initiates outbound network communication and account creation can exfiltrate metadata, create persistent identifiers, and expose the agent to untrusted remote control flows.

Content

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

md
# Register if no key
if [ -z "${SK:-}" ]; then
  RESP=$(curl -s -X POST "$API" -H "Content-Type: application/json" \
    -d "{\"action\":\"register\",\"agent_id\":\"$AGENT_ID\",\"name\":\"$AGENT_NAME\"}")
  SK=$(echo "$RESP" | jq -r '.secretKey // empty')
  [ -z "$SK" ] && echo "Registration failed: $RESP" && exit 1

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
SK=$(echo "$RESP" | jq -r '.secretKey // empty')
  [ -z "$SK" ] && echo "Registration failed: $RESP" && exit 1
  mkdir -p -m 700 "$STORE/$AGENT_ID"
  echo "$SK" > "$STORE/$AGENT_ID/key"; chmod 600 "$STORE/$AGENT_ID/key"
  echo "$AGENT_NAME" > "$STORE/$AGENT_ID/name"
  echo "$AGENT_ID" > "$STORE/active"
  echo "Registered: $AGENT_ID"

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

This sends an authenticated request with a bearer secret to a remote service, meaning the skill is directing the agent to use stored credentials in outbound traffic. If the endpoint is compromised, spoofed, or misconfigured, the credential can be abused and the agent's account state manipulated or tracked.

Content

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

md
fi

# Claim chips
curl -s -X POST "$API" -H "Content-Type: application/json" \
  -H "Authorization: Bearer $SK" -d '{"action":"claim"}' | jq -r '.message'

# Join best available table

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The skill performs another authenticated state-changing call to a third-party API, joining a room and committing funds automatically. This increases risk because the agent is not merely reading data; it is taking actions with external side effects based on untrusted remote responses.

Content

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

md
ROOM=$(echo "$ROOMS" | jq -r '[.rooms[] | select(.playerCount < .maxPlayers)] | sort_by(-.playerCount) | .[0].id // "casino_low_1"')
BUYIN=20000

curl -s -X POST "$API" -H "Content-Type: application/json" \
  -H "Authorization: Bearer $SK" \
  -d "{\"action\":\"join\",\"room_id\":\"$ROOM\",\"buy_in\":$BUYIN}" | jq -r '.message // .error'

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

The repeated play commands instruct the agent to make authenticated, state-changing requests to an external service in an open-ended loop of remote interaction. This effectively turns the skill into a controller for a third-party system, increasing exposure to prompt-driven misuse, data leakage, and unintended spending or behavior.

Content

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

Step 4: Execute Your Move

After your analysis, submit your chosen action with a single curl command:

bash
# fold

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
75% confidence
Finding

The file says every decision must include written analysis and that this analysis is internal and never shown in chat. While poker naturally involves hidden strategy, this is still a natural-language instruction to conceal reasoning from the user-visible channel and may conflict with organizational transparency expectations if not clearly scoped.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.