Back to skill

Security audit

Gambling Analyst

Security checks for vulnerabilities and agentic risk

Overview

This skill is a live crypto-casino betting helper presented as analysis/backtesting, with insufficient guardrails for real-money actions.

Review carefully before installing. This skill can register with a casino service and place repeated live bets using an API key, with no built-in spend limits or confirmation. Only use it, if at all, in a sandbox or with strict external account limits, and do not rely on its verification report unless verification is independently implemented and checked.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/analyst.sh:42
Finding

Remote API Response Is Interpolated into Executable Python Source

Content
View full analysis
/dev/null || echo "False") PAYOUT=$(echo "$RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin).get('payout', 0))" 2>/dev/null || echo "0") TOTAL_WAGERED=$((TOTAL_WAGERED + BET)) if [ "$WON" = "True" ]; then WINS=$((WINS + 1)) TOTAL_PAYOUT=$(python3 -c "print($TOTAL_PAYOUT + $PAYOUT)") ``` ### Technical Analysis The `payout` property is extracted from a remote JSON response and stored in `PAYOUT`. Instead of passing that value to Python as data, line 49 directly interpolates it into the source code supplied to `python3 -c`. JSON parsing does not enforce that `payout` is numeric. If the endpoint returns a string containing valid Python syntax, `print()` emits the string without quotation marks. The emitted value is subsequently inserted into a new Python program and evaluated as code. HTTPS reduces the likelihood of network tampering but does not make remote response data safe for source-code interpolation. Exploitation remains possible if the external service is compromised, behaves maliciously, or its trusted network path is subverted. ### Attack Path 1. The script submits a bet to `https://agent.rollhub.com/api/v1/bet`. 2. An attacker with control over the API response returns a `payout` property containing a crafted Python expression. 3. The first Python command parses the JSON and prints that property as text. 4. The shell stores the attacker-controlled text in `PAYOUT`. 5. Line 49 constructs a new `python3 -c` program containing that text. 6. Python evaluates the injected expression, allowing operating-system commands or arbitrary Python operations to run. ### Impact Assessment Successful exploitation provides ...[truncated 483 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/analyst.sh:7
Finding

Unvalidated CLI Arguments Reach Shell Arithmetic and Dynamically Generated Python

Content
View full analysis
/dev/null || echo "N/A")" ``` ### Technical Analysis The script accepts `ROUNDS` and `BET` without validating their syntax, sign, magnitude, or numeric type. `ROUNDS` is expanded unquoted into `seq`, permitting word splitting, glob expansion, option/operand manipulation, and excessive loop counts. It is also embedded directly inside Python source at line 65. `BET` reaches Bash arithmetic evaluation. Bash arithmetic syntax is not equivalent to strict integer parsing: values can be recursively interpreted as arithmetic expressions and may include variable or array-reference syntax. Treating untrusted text as an arithmetic expression can therefore produce unexpected evaluation behavior, including command-execution primitives in vulnerable expression forms. The lack of bounds also allows extremely large round counts or wager amounts. Because each round performs an irreversible remote casino bet, malformed or excessive values can cause direct financial loss and resource exhaustion. ### Attack Path 1. An untrusted caller, automated agent request, or wrapper invokes `analyst.sh` with crafted `ROUNDS` or `BET` arguments. 2. A malicious `ROUNDS` value is split into multiple `seq` operands or inserted into the Python program used to calculate the win rate. 3. Alternatively, a crafted ` ...[truncated 798 chars]
Remediation
View remediation
&2 exit 2 } (( ROUNDS <= 1000 )) || { echo "ROUNDS exceeds the configured limit" >&2 exit 2 } [[ "$BET" =~ ^[1-9][0-9]*$ ]] || { echo "BET must be a positive integer" >&2 exit 2 } for ((i = 1; i <= ROUNDS; i++)); do # Submit the validated wager. done ``` - Pass calculation inputs to Python through `sys.argv` and parse them as `int` or `Decimal`; do not build Python source using shell variables. - Require explicit confirmation for real wagering, particularly when the total requested wager exceeds a low default threshold. - Implement server-side or account-level spending limits in addition to local validation. ]]>

other

Warning
Location
references/report-template.md:8
Finding

Report Template Unconditionally Claims Provably Fair Verification

Content
View full analysis
` endpoint, retain bet identifiers, validate a SHA3-384 hash chain, or count verification failures. `SKILL.md` instructs users to use this template when generating a report. Consequently, a report can present successful verification as a fact even though the executable implementation gathered no evidence supporting that conclusion. This is not direct tool replacement or API hijacking, so it is classified as an unlisted integrity-reporting issue rather than `T07`. ### Attack Path 1. A user runs `scripts/analyst.sh`, which places bets but does not retain or verify their identifiers. 2. The Skill uses `references/report-template.md` to produce the requested comparison report. 3. The static check mark and “Zero discrepancies found” statement remain in the generated output. 4. The user interprets the outcomes as cryptographically verified. 5. Financial or analytical decisions may then be made using an unsupported integrity claim. ### Impact Assessment The issue undermines report integrity and can give users false confidence in casino results. It does not grant operating-system privileges or direct access to additional data. Its practical scope includes inaccurate audit records, unreliable research conclusions, and financial decisions based on outcomes represented as verified when verification was never performed. ]]>
Remediation
View remediation
` for each recorded bet and validate the complete expected verification response. - Track verified, failed, and unavailable results separately. - Populate the report only from measured verification data. - Prevent a report from stating that all bets were verified unless: - every expected bet has a recorded identifier; - every verification request succeeded; - every local cryptographic check passed; and - the number of verified records equals the number of successfully placed bets. A safer template would be: ```markdown - **Verification status:** {verification_status} - **Bets successfully placed:** {placed_count} - **Bets verified:** {verified_count} - **Verification failures:** {verification_failure_count} - **Verification unavailable:** {verification_unavailable_count} ``` ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (12)

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The header comments describe the script as a strategy simulation runner, but the implementation performs actual betting against a remote casino API. This mismatch increases the likelihood of deceptive or unsafe use because operators may trust the documentation and run it without realizing it places real-money bets.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/analyst.sh (reported line 38)May include surrounding context.

sh
PAYLOAD="{\"game\": \"dice\", \"amount\": $BET, \"target\": 50, \"over\": true}"
  fi

  RESPONSE=$(curl -s -X POST "$API_BASE/bet" \
    -H "Authorization: Bearer $AGENT_CASINO_API_KEY" \
    -H "Content-Type: application/json" \
    -d "$PAYLOAD")

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script is presented as a research/backtesting tool, but it sends authenticated POST requests to the live /bet endpoint inside a loop, causing repeated real wagers. This is dangerous because a user expecting simulation may unknowingly spend funds, and the loop can amplify losses quickly across many rounds.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script places live bets in a loop with no explicit runtime warning, confirmation, or guardrail that real funds will be wagered repeatedly. In the context of a skill marketed for research and strategy analysis, this makes accidental financial loss substantially more likely and can result in rapid bankroll depletion.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill includes shell commands and automation steps but declares no explicit tool scope or permission boundaries. That increases the chance an agent will execute networked shell commands by default, enabling unintended registration, betting, or other external actions without least-privilege controls.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This section promotes real betting and API registration on a live crypto casino without prominent warnings about financial loss, legality, addiction risk, or that actions may use real funds. In this skill context, the omission is dangerous because users may treat the workflow as harmless analysis while actually onboarding to live wagering.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

The registration command transmits user-supplied data to an external service and includes a hard-coded referral code. While not inherently malicious, it causes unreviewed outbound communication and account creation, and the embedded referral identifier may create undisclosed incentive or tracking concerns.

Content

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

Registration

bash
curl -X POST https://agent.rollhub.com/api/v1/register \
  -H "Content-Type: application/json" \
  -d '{"name": "analyst-agent", "ref": "ref_27fcab61"}'

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The backtest instructions tell users to place 100 live micro-bets in a loop, which automates repeated spending and can quickly scale losses or trigger harmful gambling behavior. Because the skill is specifically for casino strategy testing, the context makes this more dangerous than generic API examples: the command is a ready-made spending automation primitive.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This document gives detailed operational guidance for gambling progression systems, bankroll sizing, and ruin calculations without any warning about financial loss, addictive behavior, or the fact that negative expected value games remain losing propositions regardless of staking system. In the context of a gambling strategy analysis skill, the omission can normalize risky betting behavior and make harmful strategies like Martingale appear analytically endorsed or safer than they are.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/analyst.sh (reported line 16)May include surrounding context.

sh
if [ -z "$AGENT_CASINO_API_KEY" ]; then
  echo "Error: Set AGENT_CASINO_API_KEY environment variable"
  echo "Register first:"
  echo "  curl -X POST $API_BASE/register -H 'Content-Type: application/json' -d '{\"name\": \"analyst\", \"ref\": \"ref_27fcab61\"}'"
  exit 1
fi

External Transmission

Medium
Category
Data Exfiltration
Confidence
97% confidence
Finding

The script transmits authenticated betting requests and wager parameters to an external service, exposing the user's API credential in active use and causing outbound actions with financial consequences. In this skill context, the danger is elevated because the transmission is not just telemetry; it triggers live gambling operations contrary to the expected backtesting purpose.

Content

Scanner excerpt · scripts/analyst.sh (reported line 38)May include surrounding context.

sh
PAYLOAD="{\"game\": \"dice\", \"amount\": $BET, \"target\": 50, \"over\": true}"
  fi

  RESPONSE=$(curl -s -X POST "$API_BASE/bet" \
    -H "Authorization: Bearer $AGENT_CASINO_API_KEY" \
    -H "Content-Type: application/json" \
    -d "$PAYLOAD")

Static analysis

No suspicious patterns detected.