Back to skill

Security audit

genius-referrals-api

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its stated Genius Referrals API purpose, but its helper can make authenticated business-data changes or deletions without technically enforcing the confirmations promised in the instructions.

Install only if you are comfortable giving the skill access to a Genius Referrals API token that may allow account changes, payouts/redemptions, forced bonuses, or deletions. Use a least-privilege token, verify the publisher/provenance, keep the base URL on the official API host, and require a human-reviewed dry run before any non-GET request.

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
scripts/gr_api.py:25
Finding

State-Changing API Operations Bypass the Documented Confirmation Gate

Content
View full analysis

Vulnerability Details

File Location: scripts/gr_api.py, lines 25–70
Vulnerability Type: Missing authorization and confirmation enforcement for destructive API operations
Risk Level: High

Relevant code:

python
parser.add_argument("method", choices=["GET", "POST", "PUT", "PATCH", "DELETE"])
parser.add_argument("path", help="API path, e.g. /accounts/{account_slug}/advocates")
parser.add_argument("--base-url", default=os.environ.get("GR_API_BASE_URL", "https://api.geniusreferrals.com"))
parser.add_argument("--token", default=os.environ.get("GR_API_TOKEN"))
parser.add_argument("--account", default=os.environ.get("GR_ACCOUNT_SLUG"))
parser.add_argument("--path-param", action="append", default=[], help="Path replacement as key=value")
parser.add_argument("--query", action="append", default=[], help="Query param as key=value")
parser.add_argument("--json", default=None, help="JSON request body")
args = parser.parse_args()

if not args.token:
    raise SystemExit("Missing GR_API_TOKEN or --token")

path_params = parse_pairs(args.path_param)
if args.account:
    path_params.setdefault("account_slug", args.account)

path = args.path
for key, value in path_params.items():
    path = path.replace("{" + key + "}", urllib.parse.quote(value, safe=""))

if "{" in path or "}" in path:
    raise SystemExit(f"Unresolved path parameter in: {path}")

query = urllib.parse.urlencode(parse_pairs(args.query))
url = args.base_url.rstrip("/") + "/" + path.lstrip("/")
if query:
    url += "?" + query

body = None
headers = {
    "Accept": "application/json",
    "X-Auth-Token": args.token,
}
if args.json is not None:
    try:
        json.loads(args.json)
    except json.JSONDecodeError as error:
        raise SystemExit(f"Invalid JSON request body: {error.msg} at position {error.pos}") from None
    body = args.json.encode("utf-8")
    headers["Content-Type"] = "application/json"

req
...[truncated 2486 chars]
Remediation
View remediation

Remediation Suggestions

  • Make the helper read-only by default and reject all non-GET methods unless a separate mutation mode is explicitly enabled.
  • Implement a real dry-run mode that emits the normalized method, destination, account, endpoint, payload keys, expected impact, and rollback plan without sending a request.
  • Require a non-optional confirmation artifact for every mutation. Bind it cryptographically or structurally to the exact normalized method, base URL, account, path, query, and request-body digest so it cannot authorize a different operation.
  • Add a stronger confirmation tier for DELETE, forced bonuses, payout actions, and redemption updates.
  • Require the production environment and account slug to be explicitly identified for mutations instead of relying only on implicit environment defaults.
  • Enforce authentication testing before account-scoped changes, as required by SKILL.md.
  • Consider endpoint allowlists and operation-specific validation rather than permitting arbitrary paths for state-changing methods.
  • Keep authorization enforcement inside the executable helper so direct invocation cannot bypass policy stated only in documentation.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (14)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/endpoint-catalog.md (reported line 26)May include surrounding context.

Endpoints Seen In Public Docs

text
DELETE /accounts/{account_slug}/advocates
DELETE /accounts/{account_slug}/advocates/{advocate_token}
DELETE /accounts/{account_slug}/advocates/{advocate_token}/referrals/{referral_id}
DELETE /accounts/{account_slug}/bonuses/{bonus_id}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/endpoint-catalog.md (reported line 27)May include surrounding context.

text
DELETE /accounts/{account_slug}/advocates
DELETE /accounts/{account_slug}/advocates/{advocate_token}
DELETE /accounts/{account_slug}/advocates/{advocate_token}/referrals/{referral_id}
DELETE /accounts/{account_slug}/bonuses/{bonus_id}
DELETE /accounts/{account_slug}/bonuses/{bonus_id}/tags/{tag_slug}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/endpoint-catalog.md (reported line 28)May include surrounding context.

text
DELETE /accounts/{account_slug}/advocates
DELETE /accounts/{account_slug}/advocates/{advocate_token}
DELETE /accounts/{account_slug}/advocates/{advocate_token}/referrals/{referral_id}
DELETE /accounts/{account_slug}/bonuses/{bonus_id}
DELETE /accounts/{account_slug}/bonuses/{bonus_id}/tags/{tag_slug}
DELETE /accounts/{account_slug}/products/{product_slug}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/endpoint-catalog.md (reported line 29)May include surrounding context.

md
DELETE /accounts/{account_slug}/advocates
DELETE /accounts/{account_slug}/advocates/{advocate_token}
DELETE /accounts/{account_slug}/advocates/{advocate_token}/referrals/{referral_id}
DELETE /accounts/{account_slug}/bonuses/{bonus_id}
DELETE /accounts/{account_slug}/bonuses/{bonus_id}/tags/{tag_slug}
DELETE /accounts/{account_slug}/products/{product_slug}
DELETE /accounts/{account_slug}/products/{product_slug}/variants/{variant_id}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/endpoint-catalog.md (reported line 30)May include surrounding context.

md
DELETE /accounts/{account_slug}/advocates/{advocate_token}
DELETE /accounts/{account_slug}/advocates/{advocate_token}/referrals/{referral_id}
DELETE /accounts/{account_slug}/bonuses/{bonus_id}
DELETE /accounts/{account_slug}/bonuses/{bonus_id}/tags/{tag_slug}
DELETE /accounts/{account_slug}/products/{product_slug}
DELETE /accounts/{account_slug}/products/{product_slug}/variants/{variant_id}
DELETE /accounts/{account_slug}/tags/{tag_slug}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/endpoint-catalog.md (reported line 31)May include surrounding context.

md
DELETE /accounts/{account_slug}/advocates/{advocate_token}/referrals/{referral_id}
DELETE /accounts/{account_slug}/bonuses/{bonus_id}
DELETE /accounts/{account_slug}/bonuses/{bonus_id}/tags/{tag_slug}
DELETE /accounts/{account_slug}/products/{product_slug}
DELETE /accounts/{account_slug}/products/{product_slug}/variants/{variant_id}
DELETE /accounts/{account_slug}/tags/{tag_slug}
DELETE /accounts/{account_slug}/vouchers/{voucher_id}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/endpoint-catalog.md (reported line 32)May include surrounding context.

md
DELETE /accounts/{account_slug}/bonuses/{bonus_id}
DELETE /accounts/{account_slug}/bonuses/{bonus_id}/tags/{tag_slug}
DELETE /accounts/{account_slug}/products/{product_slug}
DELETE /accounts/{account_slug}/products/{product_slug}/variants/{variant_id}
DELETE /accounts/{account_slug}/tags/{tag_slug}
DELETE /accounts/{account_slug}/vouchers/{voucher_id}
DELETE /accounts/{account_slug}/widgets-packages/{widgets_package_slug}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/endpoint-catalog.md (reported line 33)May include surrounding context.

md
DELETE /accounts/{account_slug}/bonuses/{bonus_id}/tags/{tag_slug}
DELETE /accounts/{account_slug}/products/{product_slug}
DELETE /accounts/{account_slug}/products/{product_slug}/variants/{variant_id}
DELETE /accounts/{account_slug}/tags/{tag_slug}
DELETE /accounts/{account_slug}/vouchers/{voucher_id}
DELETE /accounts/{account_slug}/widgets-packages/{widgets_package_slug}
GET /accounts

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/endpoint-catalog.md (reported line 34)May include surrounding context.

md
DELETE /accounts/{account_slug}/products/{product_slug}
DELETE /accounts/{account_slug}/products/{product_slug}/variants/{variant_id}
DELETE /accounts/{account_slug}/tags/{tag_slug}
DELETE /accounts/{account_slug}/vouchers/{voucher_id}
DELETE /accounts/{account_slug}/widgets-packages/{widgets_package_slug}
GET /accounts
GET /accounts/{account_slug}

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/endpoint-catalog.md (reported line 35)May include surrounding context.

md
DELETE /accounts/{account_slug}/products/{product_slug}/variants/{variant_id}
DELETE /accounts/{account_slug}/tags/{tag_slug}
DELETE /accounts/{account_slug}/vouchers/{voucher_id}
DELETE /accounts/{account_slug}/widgets-packages/{widgets_package_slug}
GET /accounts
GET /accounts/{account_slug}
GET /accounts/{account_slug}/advocates

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill instructs use of environment-backed credentials and live network access to an external API, but it does not declare any tool scope or allowed-tools boundaries. That creates an authorization and review gap: an agent may be able to access secrets and make outbound API calls without explicit least-privilege constraints, increasing the chance of unintended data access or state-changing actions.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · references/endpoint-catalog.md (reported line 3)May include surrounding context.

md
# Genius Referrals API Endpoint Catalog

Source: https://api.geniusreferrals.com/doc fetched 2026-07-23 UTC.

Auth header: `X-Auth-Token`

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file documents numerous DELETE, PATCH, PUT, and POST endpoints that can modify or remove account, advocate, product, voucher, and referral data, but it provides no warning that these operations may be destructive or irreversible. Under the markdown-specific warning criterion, documentation that omits caution about behaviors affecting user data or system integrity should be flagged.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code constructs an authenticated HTTP request using the X-Auth-Token header and sends it to a remote API, but there is no confirmation prompt or user-facing notice before transmission. Because this helper can issue mutating requests including POST, PUT, PATCH, and DELETE, a visible warning would improve user awareness of remote data transmission and side effects.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.