Back to skill

Security audit

Sports Events Query

Security checks for vulnerabilities and agentic risk

Overview

This sports-query skill is purpose-aligned and uses a fixed public sports API, with only ordinary dependency and reliability cautions.

Before installing, be aware that it will make outbound HTTPS requests to TheSportsDB and install/use the Python `requests` package. Prefer a virtual environment and pinned dependencies if reproducibility matters. The output may include Chinese labels even when invoked from an English workflow.

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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:73
Finding
Unpinned Third-Party Dependency Installation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 73-77 **Vulnerability Type**: Supply-chain risk from an unpinned dependency **Risk Level**: Medium ### Vulnerable Code ```markdown ## Installation ```bash pip install requests ``` ``` ### Technical Analysis The installation instructions retrieve `requests` without specifying an exact version or verifying an integrity hash. Consequently, the installed artifact depends on the package index, resolver configuration, and package state at installation time rather than on an immutable, reviewed dependency set. No evidence indicates that the current `requests` package is malicious. The risk arises because a compromised package release, package index, mirror, or local package-manager configuration could cause users to install and subsequently import unreviewed code. ### Attack Path 1. An attacker compromises the configured package source, a future dependency release, or the user's package-index configuration. 2. The user follows the documented `pip install requests` instruction. 3. The resolver downloads the attacker-controlled or otherwise compromised artifact because no version or hash is enforced. 4. Malicious package code may execute during installation or when `sports_api.py` imports `requests`. 5. The code runs with the privileges of the user or Agent process that performed the installation or invoked the Skill. ### Impact Assessment Successful exploitation could execute arbitrary code with the invoking user's privileges. This may expose files, environment variables, credentials accessible to that account, and network resources reachable from the execution environment. The Skill itself does not request elevated privileges, so this issue does not independently grant administrator or root access. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions - Pin `requests` and all transitive dependencies to reviewed versions in a lock file. - Require package hashes, for example with `pip install --require-hashes -r requirements.txt`. - Install only from a trusted package index over authenticated HTTPS. - Use automated dependency scanning and controlled update reviews. - Prefer an isolated virtual environment with only the permissions required by this Skill. - Document a reproducible installation command that consumes the locked dependency file rather than installing the mutable latest release. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/sports_api.py:55
Finding
Country API Request Has No Timeout<![CDATA[ ## Vulnerability Details **File Location**: `scripts/sports_api.py`, lines 55-60 **Vulnerability Type**: Unbounded external network request **Risk Level**: Low ### Vulnerable Code ```python def get_countries() -> List[Dict]: """Get list of available countries""" response = requests.get(f"{BASE_URL}/all_countries.php") data = response.json() return data.get("countries", []) ``` ### Technical Analysis The `requests.get` call does not define a connection or read timeout. Python Requests does not impose a default timeout, so the call can remain blocked indefinitely if connection establishment or response delivery stalls. The endpoint is fixed to an HTTPS URL and cannot be directly redirected through user input in this code. Exploitation therefore depends on disruption or control of the upstream service, network path, proxy configuration, or DNS environment. This is an availability weakness rather than a privilege-escalation or code-execution vulnerability. ### Attack Path 1. The Skill invokes `get_countries`. 2. The upstream API, configured proxy, or network path accepts the connection but does not complete the response. 3. Because no timeout is configured, the request remains blocked. 4. The CLI or Agent workflow cannot complete and retains its process and associated resources until externally terminated. ### Impact Assessment The impact is limited to availability of the invoking process and workflows waiting for it. An attacker may cause execution hangs and resource retention, but this issue provides no additional system privileges and does not by itself expose data or permit arbitrary code execution. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions - Apply explicit connection and read timeouts, for example: ```python response = requests.get( f"{BASE_URL}/all_countries.php", timeout=(3.05, 10), ) ``` - Catch `requests.RequestException` and return a controlled error. - Check the HTTP status before parsing the response by calling `response.raise_for_status()`. - Consider bounded retries with exponential backoff only for transient failures. - Centralize network requests in one helper so timeout and error-handling rules are applied consistently. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/sports_api.py:134
Finding
League Events API Request Has No Timeout<![CDATA[ ## Vulnerability Details **File Location**: `scripts/sports_api.py`, lines 134-143 **Vulnerability Type**: Unbounded external network request **Risk Level**: Low ### Vulnerable Code ```python def get_events_by_league(league_id: str, season: Optional[str] = None) -> List[Dict]: """Get events for a specific league""" params = {"id": league_id} if season: params["season"] = season response = requests.get(f"{BASE_URL}/eventsseason.php", params=params) data = response.json() return data.get("events", []) ``` ### Technical Analysis The league-events request omits a connection and read timeout. Although `league_id` and `season` are sent as query parameters and cannot alter the fixed API hostname, a stalled API, proxy, or network path can keep this call blocked indefinitely. This function also lacks local request-error handling and status validation. Exceptions propagate to the broad handler in `main`, but that handler cannot recover while an unbounded request remains stalled. ### Attack Path 1. A user invokes the `league` command. 2. The script resolves a league and calls `get_events_by_league`. 3. The upstream service or an intermediary accepts the request but delays the response indefinitely. 4. With no timeout, the process remains blocked. 5. The associated Agent task remains unavailable until the process or network operation is externally terminated. ### Impact Assessment Successful exploitation can deny service to the current CLI or Agent workflow and retain process resources. The weakness does not grant filesystem access, elevated privileges, or arbitrary code execution. Its scope is primarily the process making the request and any automation waiting for its completion. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions - Add explicit connection and read timeouts: ```python response = requests.get( f"{BASE_URL}/eventsseason.php", params=params, timeout=(3.05, 10), ) ``` - Catch `requests.Timeout` and other `requests.RequestException` subclasses. - Validate the response with `response.raise_for_status()` before calling `response.json()`. - Return a controlled failure result or clear error message instead of relying solely on the top-level exception handler. - If retries are required, use a small bounded retry count with exponential backoff and an overall operation deadline. ]]>
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 (3)

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The example outputs switch to Chinese labels such as '赛事', '简称', '主场', and '位置' even though the skill description does not state that responses may be localized this way or give the user a language choice. This creates a natural-language locale policy concern because the skill appears to enforce a specific language without opt-in or justification.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The formatter emits labels such as "简称", "主场", "国家", and "简介" directly in Chinese, and similar fixed Chinese output appears throughout command handlers. This imposes a specific language on all users without opt-in or a documented locale constraint, which matches the language/locale policy violation criterion.

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
Messages like "今日无赛事", "暂无直播赛事", "未找到球队", "找到 ... 个联赛", and the Chinese heading text are presented unconditionally. Because the file offers no user language choice and no justification for a Chinese-only audience, this is a natural-language locale policy violation.

Static analysis

No suspicious patterns detected.