Back to skill

Security audit

Fairness Auditor

Security checks for vulnerabilities and agentic risk

Overview

This skill is an Agent Casino audit helper, but it pushes live betting and account registration, overstates independent verification, and includes an exposed publishing token.

Review carefully before installing. Do not run the betting commands unless you understand the legal, account, privacy, and financial implications. Treat reports from this skill as weak evidence unless you independently verify each bet from raw commitment, seed, client seed, nonce, and result data. The publisher should revoke the exposed ClawHub token and remove it from artifacts and history before publication.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
RETRY_PUBLISH.txt:1
Finding
Plaintext ClawHub Publishing Token Included in Project<![CDATA[ ## Vulnerability Details **File Location**: `RETRY_PUBLISH.txt:1` **Vulnerability Type**: Hardcoded plaintext credential **Risk Level**: High ### Vulnerable Code ```bash Retry: CLAWHUB_TOKEN=clh_[REDACTED] npx clawhub publish ./rollhub-auditor --slug rollhub-auditor --name 'Fairness Auditor' --version 1.0.0 ``` The original file contains the complete token; it is redacted here to prevent further credential exposure. ### Technical Analysis A ClawHub publishing token is stored directly in a project file. Any user, automated scanner, build system, package consumer, or source-control collaborator with access to the artifact can retrieve the credential without authentication. Secrets embedded in distributed artifacts must be considered compromised because deleting the current file does not remove copies from package archives, caches, logs, forks, or repository history. ### Attack Path 1. An attacker obtains the project artifact or reads its source history. 2. The attacker extracts the `CLAWHUB_TOKEN` value from `RETRY_PUBLISH.txt`. 3. The attacker presents the token to the ClawHub CLI or API. 4. If the token remains valid and has publishing privileges, the attacker publishes or modifies content authorized by the token. 5. Downstream users may receive attacker-controlled Skill content under a trusted package identity. ### Impact Assessment If valid, the token can expose the publishing privileges assigned to its owner. Potential consequences include unauthorized package publication, package tampering, malicious release distribution, reputational damage, and downstream supply-chain compromise. The exact scope is limited by the token's server-side permissions, which cannot be determined from static analysis. This issue does not directly grant operating-system privileges on a consumer's machine, but compromised releases could subsequently target package users. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions 1. Revoke the exposed token immediately and generate a replacement. 2. Audit ClawHub publication and account logs for unauthorized activity. 3. Remove the token from the current artifact and all accessible repository history. 4. Store replacement credentials in a protected secret manager or CI/CD secret store. 5. Pass the secret through a protected environment variable only at execution time. 6. Restrict the replacement token to the minimum required package, operation, and lifetime. 7. Add secret scanning to commits, build artifacts, and release pipelines. 8. Prevent environment variables and command lines containing secrets from being printed to logs. ]]>

T08 · Insecure Dependencies

Warning
Location
RETRY_PUBLISH.txt:1
Finding
Unpinned Package Execution Through npx in Publishing Command<![CDATA[ ## Vulnerability Details **File Location**: `RETRY_PUBLISH.txt:1` **Vulnerability Type**: Unpinned executable dependency **Risk Level**: Medium ### Vulnerable Code ```bash Retry: CLAWHUB_TOKEN=clh_[REDACTED] npx clawhub publish ./rollhub-auditor --slug rollhub-auditor --name 'Fairness Auditor' --version 1.0.0 ``` ### Technical Analysis The command invokes `npx clawhub` without specifying an exact reviewed version or integrity value. Depending on the local environment and npm configuration, `npx` can resolve and download a package from the configured registry when no suitable local package is installed. Consequently, the code executed by this command can change after the project has been audited. The command also supplies a publishing credential to the process environment, increasing the impact of a compromised dependency. The file is an operational retry instruction rather than an automatically executed project script. Exploitation therefore requires a user or automation system to run the documented command. ### Attack Path 1. A publisher follows the retry instruction. 2. No trusted local `clawhub` executable is available, or dependency resolution selects a remote release. 3. `npx` retrieves an unreviewed or compromised package version from the configured registry. 4. Package installation hooks or CLI code execute with the publisher's user privileges. 5. Malicious code reads `CLAWHUB_TOKEN` from the environment, accesses files available to the publisher, or publishes attacker-controlled content. ### Impact Assessment A compromised package would execute with the operating-system privileges of the user running the command. It could access that user's files and environment variables, including the publishing token, and could misuse the user's package-publishing authority. This does not inherently provide root or administrator access. The attainable scope depends on the publisher's local privileges, filesystem access, registry configuration, ...[truncated 28 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Install a reviewed, exact version of the ClawHub CLI through a lockfile-controlled dependency. 2. Verify the package source and lockfile integrity metadata before use. 3. Run the locally installed executable with `npx --no-install clawhub ...` or an equivalent fixed local path. 4. Do not combine dependency acquisition and credentialed publishing in one command. 5. Perform installation and review before making the publishing token available to the process. 6. Use a minimally privileged, short-lived publishing token in an isolated CI/CD environment. 7. Disable unnecessary npm lifecycle scripts where operationally compatible. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/audit.sh:42
Finding
Fairness Audit Trusts the Casino's Self-Reported Verification Result<![CDATA[ ## Vulnerability Details **File Location**: `scripts/audit.sh:42-44` **Vulnerability Type**: Improper trust boundary and insufficient independent verification **Risk Level**: High ### Vulnerable Code ```bash VERIFY=$(curl -s "$API_BASE/verify/$BET_ID" -H "Authorization: Bearer $AGENT_CASINO_API_KEY") STATUS=$(echo "$VERIFY" | python3 -c "import sys,json; d=json.load(sys.stdin); print('VALID' if d.get('verified',False) else 'INVALID')" 2>/dev/null || echo "UNKNOWN") TOTAL=$((TOTAL + 1)) ``` ### Technical Analysis The Skill claims to perform zero-trust cryptographic verification, but the executable script does not independently: - Recalculate `SHA3-384(server_seed)` and compare it with the pre-bet commitment. - Derive the AES-256-CTR output from the server seed, client seed, and nonce. - Compare the locally derived outcome with the reported bet result. Instead, the script queries an endpoint controlled by the same casino being audited and treats its `verified` Boolean as authoritative. This violates the required trust boundary: the audited party can attest to its own correctness. The project documentation contains example local verification algorithms, but `scripts/audit.sh` does not call or implement them. Furthermore, the script categorizes any recognized bet with a response other than `verified: true` as tampered, without distinguishing cryptographic mismatches from network, authorization, schema, or server errors. ### Attack Path 1. The casino or a compromised API records or returns a manipulated outcome. 2. The same API responds to `/verify/<bet_id>` with JSON containing `"verified": true`. 3. The script maps this server-controlled value to `STATUS=VALID`. 4. The valid-bet counter is incremented, and no tampering warning is emitted. 5. The `report` command incorporates this result and can state that all bets were verified. 6. An auditor relying on the report accepts a false fairness conclusion. ### Impact Assessment The issue compromis ...[truncated 393 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Retrieve the raw pre-bet commitment, revealed server seed, client seed, nonce, claimed outcome, and game type. 2. Independently calculate the SHA3-384 commitment locally and reject any mismatch. 3. Independently derive the outcome using the precisely specified SHA-256 and AES-256-CTR procedure. 4. Compare the locally derived result with the original recorded result, not a server-provided verification Boolean. 5. Preserve the commitment as observed before placing the bet; post-bet data supplied by the server alone cannot prove that the commitment was not replaced. 6. Validate HTTP status codes, TLS failures, response schemas, numeric ranges, and required fields. 7. Report network, authorization, malformed-response, and cryptographic failures as separate states. 8. Store immutable evidence necessary for third-party reproduction of every verification. 9. Add known-answer tests to ensure the local Python and JavaScript implementations produce identical results. 10. Require verification to fail closed if any required evidence is unavailable. ]]>
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 (14)

Natural-Language Policy Violations

High
Confidence
99% confidence
Finding
The file contains a plaintext `CLAWHUB_TOKEN` value directly embedded in a publish command, which exposes a usable credential to anyone who can read the file, logs, shell history, or screenshots. Because the token is paired with a publishing action, compromise could let an attacker publish, modify, or impersonate the associated skill or account.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill markets itself as a zero-trust cryptographic auditor, but its documented workflow includes registration and placing live bets while relying on remote API responses rather than demonstrably local verification. This mismatch can mislead users or agents into performing financial and external actions under false assumptions of safety and rigor, increasing the chance of unintended spending, data disclosure, and incorrect trust decisions.

Missing User Warnings

High
Confidence
97% confidence
Finding
The skill instructs users to register with an external gambling-related service and place real test bets without clear warnings about monetary loss, account creation, or data transfer. In context, this is especially dangerous because the task is framed as an audit, which may cause users to underestimate that they are being guided into live financial activity.

External Script Fetching

High
Category
Supply Chain
Content
if [ -z "$AGENT_CASINO_API_KEY" ]; then
  echo "Error: Set AGENT_CASINO_API_KEY"
  echo "Register: curl -X POST $API_BASE/register -H 'Content-Type: application/json' -d '{\"name\": \"auditor\", \"ref\": \"ref_27fcab61\"}'"
  exit 1
fi
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The skill claims cryptographic fairness verification using SHA3-384 and AES-256-CTR, but the implementation only calls a remote `/verify/{bet_id}` endpoint and performs simple local statistics. This creates a trust gap where the purported auditor merely trusts the service being audited, enabling false assurance and defeating the zero-trust security claims in the skill metadata.

External Script Fetching

High
Category
Supply Chain
Content
while IFS= read -r line; do
      BET_ID=$(echo "$line" | python3 -c "import sys,json; print(json.load(sys.stdin).get('bet_id',''))" 2>/dev/null)
      if [ -n "$BET_ID" ] && [ "$BET_ID" != "" ]; then
        VERIFY=$(curl -s "$API_BASE/verify/$BET_ID" -H "Authorization: Bearer $AGENT_CASINO_API_KEY")
        STATUS=$(echo "$VERIFY" | python3 -c "import sys,json; d=json.load(sys.stdin); print('VALID' if d.get('verified',False) else 'INVALID')" 2>/dev/null || echo "UNKNOWN")
        TOTAL=$((TOTAL + 1))
        if [ "$STATUS" = "VALID" ]; then
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The command uses `npx clawhub` without pinning an exact package version, which allows whatever version is currently published to be fetched and executed at publish time. In a supply-chain attack or malicious package update scenario, this could execute attacker-controlled code in an environment that also contains a live credential, increasing the risk substantially.

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill includes shell-based commands (`curl`, `bash scripts/audit.sh ...`) but declares no explicit tool scope or permission boundaries. That creates an unsafe ambiguity where an agent may execute networked and potentially state-changing commands without transparent authorization controls.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The description is heavily keyword-stuffed and lacks a clear invocation boundary, which can cause overly broad matching and accidental activation in unrelated contexts. In an agent ecosystem, that raises the risk that a skill capable of network calls and financial actions is invoked when a user only asked for general security, randomness, or cryptography help.

External Transmission

Medium
Category
Data Exfiltration
Content
## Registration

```bash
curl -X POST https://agent.rollhub.com/api/v1/register \
  -H "Content-Type: application/json" \
  -d '{"name": "auditor-agent", "ref": "ref_27fcab61"}'
```
Confidence
90% confidence
Finding
The skill sends user/agent data to an external service via a registration POST request, which is an external transmission event. While external API use may be expected for this skill, the lack of disclosure and consent mechanisms makes the transmission security-relevant, especially because it creates an account relationship with a third party.

External Transmission

Medium
Category
Data Exfiltration
Content
if [ -z "$AGENT_CASINO_API_KEY" ]; then
  echo "Error: Set AGENT_CASINO_API_KEY"
  echo "Register: curl -X POST $API_BASE/register -H 'Content-Type: application/json' -d '{\"name\": \"auditor\", \"ref\": \"ref_27fcab61\"}'"
  exit 1
fi
Confidence
88% confidence
Finding
The script instructs the user to send registration data to an external service, establishing outbound data transmission to a third-party endpoint. In this skill context, external transmission is expected, but it still carries privacy, trust, and account-enrollment risk because an audit helper is directing users to register with the target system.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The script's `run` mode places live bets against a production remote API, creating real external side effects and potential financial loss instead of performing passive audit or local fairness verification. In the context of an 'auditor' skill, this is especially risky because users may reasonably expect read-only validation, not repeated wagering transactions.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The script performs repeated remote betting transactions and truncates `bets.jsonl` before execution without an explicit warning, backup, or confirmation. This can cause unintended spending and destroy prior audit evidence, which is particularly dangerous in a security-audit tool where preserving historical records matters.

Missing User Warnings

Low
Confidence
86% confidence
Finding
Report generation overwrites the existing report file unconditionally, which can erase prior audit output or evidence. While lower severity than the live betting behavior, silent destruction of prior reports is still unsafe in an auditing context where traceability and preservation are important.

Static analysis

No suspicious patterns detected.