Back to skill

Security audit

sportsinc-sportslink

Security checks for vulnerabilities and agentic risk

Overview

This Sports Inc invoice adapter is broadly purpose-aligned, but it should be reviewed because it handles live credentials and financial records with under-scoped endpoint, file, and session persistence controls.

Install only in a controlled environment for authorized Sports Inc dealer accounts. Keep SPORTSINC_API_URL at the default unless using a verified test endpoint with a test key; do not pass portal credentials in command JSON; store API keys and portal passwords in the platform secret broker or protected environment variables. Put SPORTSINC_WEB_STATE_PATH and SPORTSINC_PDF_DIR in private per-user directories, clean diagnostic captures after use, and consider provisioning Chromium during deployment instead of allowing first-run installation. Use dry-run or manual review around mark-historical until the billing workflow is confirmed.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/sportslink.py:110
Finding

API Key Can Be Redirected to an Arbitrary Endpoint

Content
View full analysis
tuple[str, str]: return ( (os.environ.get("SPORTSINC_API_URL") or "https://api.sportsinc.com/").strip().rstrip("/") + "/", (os.environ.get("SPORTSINC_API_KEY") or "").strip(), ) ``` ```python class _Client: def __init__(self, base_url: str, api_key: str, timeout: int = 30) -> None: self._base = base_url self._timeout = timeout self._s = requests.Session() self._s.headers.update({"X-API-KEY": api_key, "Accept": "application/json"}) def _request(self, method: str, path: str, *, params=None, json_body=None) -> Any: url = self._base + path.lstrip("/") last_exc = None for attempt in range(4): # resilience: retry transient failures try: resp = self._s.request( method, url, params=params, json=json_body, timeout=self._timeout, ) ``` ```python base_url, api_key = _config() if not api_key: return _fail( "config_error", "Set SPORTSINC_API_KEY (request one from mhoerner@hq.sportsinc.com).", 2, ) client = _Client(base_url, api_key) ``` ### Technical Analysis The `SPORTSINC_API_URL` environment variable controls the destination to which the authenticated `requests.Session` sends requests. The value is not parsed or validated before use. In particular, the implementation does not: - Require HTTPS. - Restrict the hostname to `api.sportsinc.com`. - Reject embedded credentials, unusual ports, or malformed URL forms. - Separate production credentials from test endpoint configuration. The `X-API-KEY` header is installed ...[truncated 1943 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/sportsweb_browser.py:284
Finding

Reusable SportsWeb Session State Is Persisted Without File Permission Hardening

Content
View full analysis
str | None: """Where to persist the logged-in session, if the operator wants one. Reusing a session avoids a full Auth0 round trip per run — and is the escape hatch if Auth0 ever adds a challenge that automation cannot answer: log in once by hand with this file set, and later runs ride the saved cookies. """ return (os.environ.get("SPORTSINC_WEB_STATE_PATH") or "").strip() or None ``` ```python state_path = _storage_state_path() with sync_playwright() as playwright: browser = _launch(playwright, headless) context_args: dict[str, Any] = { "user_agent": _USER_AGENT, "accept_downloads": True, "viewport": _VIEWPORT, "locale": "en-US", } if state_path and os.path.isfile(state_path): context_args["storage_state"] = state_path context = browser.new_context(**context_args) context.set_default_timeout(_DEFAULT_TIMEOUT_MS) context.add_init_script(_MASK_WEBDRIVER) page = context.new_page() try: yield page finally: if state_path: try: context.storage_state(path=state_path) except Exception: logger.warning( "Could not save the SportsWeb session to %s", state_path, ) ``` ### Technical Analysis Playwright storage-state files may contain reusable cookies and browser-origin state that authenticate a user without requiring the username, password, or MFA challenge again. The project explicitly uses the file as an authentication bypass for subsequent runs. The code accepts an arbitrary path and delegates creation or replacement of that file to Playwright ...[truncated 1942 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/sportslink.py:612
Finding

SportsWeb Credentials Can Be Exposed Through Command-Line Arguments

Content
View full analysis
dict[str, Any]: raw = None if len(sys.argv) >= 3: raw = sys.argv[2] elif not sys.stdin.isatty(): raw = sys.stdin.read().strip() ``` ### Technical Analysis The CLI accepts a JSON object as `sys.argv[2]`, and portal handlers allow that object to contain `username` and `password`. Supplying secrets as process arguments creates multiple exp ...[truncated 1760 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/invoice_pdf.py:81
Finding

Confidential Invoice and Portal Artifacts Are Written Without Secure File Controls

Content
View full analysis
Path: override = (os.environ.get("SPORTSINC_PDF_DIR") or "").strip() path = ( Path(override) if override else Path(tempfile.gettempdir()) / _STASH_DIRNAME ) path.mkdir(parents=True, exist_ok=True) return path ``` ```python try: from PIL import Image except ImportError: fallback = destination.with_suffix(".jp2") fallback.write_bytes(raw) return str(fallback), ( "Pillow is not installed, so the page image could not be converted to " "PNG; the raw encoded stream was written instead." ) try: with Image.open(io.BytesIO(raw)) as img: converted = img.convert("RGB") if max(converted.size) > _MAX_IMAGE_EDGE: converted.thumbnail((_MAX_IMAGE_EDGE, _MAX_IMAGE_EDGE)) converted.save(destination, format="PNG") return str(destination), None except Exception as exc: fallback = destination.with_suffix(".jp2") fallback.write_bytes(raw) ``` ```python keep_pdf = stash == "always" or (stash == "auto" and bool(image_pages)) pdf_path = None if keep_pdf and directory is not None: pdf_path = directory / f"si-{_safe_name(label)}.pdf" try: pdf_path.write_bytes(pdf_bytes) except OSError as exc: raise PdfError( f"Could not write the invoice PDF to {pdf_path}: {exc}" ) from exc pdf_path = str(pdf_path) ``` Authenticated page diagnostics are also written with ordinary file operations: ```python def save_page( self, html_path: str | None, screensh ...[truncated 3523 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/sportsweb_browser.py:303
Finding

Chromium Is Retrieved and Installed Automatically at Runtime

Content
View full analysis
None: """Download Playwright's Chromium binary (one-time, ~150 MB).""" subprocess.run( [sys.executable, "-m", "playwright", "install", "chromium"], check=True, ) def _launch(playwright, headless: bool): """Launch Chromium, auto-installing the browser binary if it is missing. The Playwright *package* is a declared dependency, but its Chromium *binary* is a separate download pip does not fetch and OpenClaw has no install hook for, so the first run installs it once and retries. """ try: return playwright.chromium.launch( headless=headless, args=_STEALTH_LAUNCH_ARGS, ) except Exception as exc: message = str(exc).lower() if not ( "executable doesn't exist" in message or "playwright install" in message ): raise SportsWebTransportError( f"Could not launch Chromium for Playwright: {exc}" ) from exc logger.info( "Chromium binary missing — installing it once (~150 MB)…" ) try: _install_chromium() except Exception as install_exc: raise SportsWebConfigError( "Chromium is not installed and the automatic install failed. " "Run `python -m playwright install chromium`. " f"(error: {install_exc})" ) from install_exc try: return playwright.chromium.launch( headless=headless, args=_STEALTH_LAUNCH_ARGS, ) ``` ### Technical Analysis When Chromium is absent, a normal Skill action invokes Playwright's installer, which retrieves a browser binary from Playwright's configured di ...[truncated 2069 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a full invoice-source adapter whose primary job is to pull invoices from the SportsLink REST API, normalize them, recover lines for header-only documents via portal PDF + OCR, and mark imported documents historical. The supplied code chunk is only a supporting portal-automation component focused on logging into SportsWeb and downloading PDFs from the Invoice Center. That browser behavior is mentioned in the description as one sub-step for header-only documents, but the major declared capabilities are absent from this code: no API access, no invoice parsing/normalization, no OCR, no line reconciliation, and no consumed/historical marking through the source workflow. The code also includes a diagnostic capture harness not reflected in the declared purpose. So the description materially overstates and misstates what this specific code chunk actually does.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill declares powerful capabilities including environment access, file read/write, network, and shell execution, but provides no explicit tool-scope or permission boundary. In practice this means a caller or orchestrator may expose far more authority than the task requires, increasing the blast radius if the skill is misused, prompt-injected, or behaves unexpectedly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file instructs the user to export portal username and password, run unattended login flows, and save session artifacts, screenshots, HTML, and downloaded files. Although the document describes the mechanics in detail, it does not clearly warn that credentials, session state, and captured portal data may be sensitive and should be handled/stored carefully.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The top-level documentation explicitly states 'no model calls, no OCR', framing this module as purely deterministic PDF handling. However, prepare() invokes _ocr_page() for scanned pages, and _ocr_page() calls into OCR engines to transcribe page images, which directly contradicts the module's stated intent.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · SKILL.md (reported line 48)May include surrounding context.

md
Environment
-----------
    SPORTSINC_API_KEY       Required. Sent as the `X-API-KEY` header.
    SPORTSINC_API_URL       Optional. Default https://api.sportsinc.com/
    SPORTSINC_DRY_RUN       Optional. If truthy, `mark-historical` is simulated.
    SPORTSINC_WEB_USERNAME  Portal login for `fetch-invoice-doc` (separate from
    SPORTSINC_WEB_PASSWORD  the API key). SPORTSINC_WEB_BASE_URL overrides the

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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/sportslink_api.md (reported line 8)May include surrounding context.

md
Environment
-----------
    SPORTSINC_API_KEY       Required. Sent as the `X-API-KEY` header.
    SPORTSINC_API_URL       Optional. Default https://api.sportsinc.com/
    SPORTSINC_DRY_RUN       Optional. If truthy, `mark-historical` is simulated.
    SPORTSINC_WEB_USERNAME  Portal login for `fetch-invoice-doc` (separate from
    SPORTSINC_WEB_PASSWORD  the API key). SPORTSINC_WEB_BASE_URL overrides the

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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/sportslink.py (reported line 47)May include surrounding context.

python
Environment
-----------
    SPORTSINC_API_KEY       Required. Sent as the `X-API-KEY` header.
    SPORTSINC_API_URL       Optional. Default https://api.sportsinc.com/
    SPORTSINC_DRY_RUN       Optional. If truthy, `mark-historical` is simulated.
    SPORTSINC_WEB_USERNAME  Portal login for `fetch-invoice-doc` (separate from
    SPORTSINC_WEB_PASSWORD  the API key). SPORTSINC_WEB_BASE_URL overrides the

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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/sportslink.py (reported line 112)May include surrounding context.

python
Environment
-----------
    SPORTSINC_API_KEY       Required. Sent as the `X-API-KEY` header.
    SPORTSINC_API_URL       Optional. Default https://api.sportsinc.com/
    SPORTSINC_DRY_RUN       Optional. If truthy, `mark-historical` is simulated.
    SPORTSINC_WEB_USERNAME  Portal login for `fetch-invoice-doc` (separate from
    SPORTSINC_WEB_PASSWORD  the API key). SPORTSINC_WEB_BASE_URL overrides the

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The capture-portal action materially expands the skill beyond its stated invoice-ingestion purpose by adding a general diagnostic browser automation path that can log into the SportsWeb portal, search records, save HTML/screenshots, and optionally trigger downloads. Even if intended for troubleshooting, this creates an additional data-exposure surface because portal contents, downloaded files, and captured page artifacts may contain invoice data, customer identifiers, or other sensitive business information and can be written to disk outside the normal controlled import flow.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/sportsweb_browser.py (reported line 306)May include surrounding context.

python
def _install_chromium() -> None:
    """Download Playwright's Chromium binary (one-time, ~150 MB)."""

    subprocess.run([sys.executable, "-m", "playwright", "install", "chromium"], check=True)


def _launch(playwright, headless: bool):

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/sportsweb_browser.py (reported line 372)May include surrounding context.

python
)
    read_fd, write_fd = os.pipe()
    try:
        proc = subprocess.Popen(
            [xvfb, "-displayfd", str(write_fd), "-screen", "0", "1440x900x24", "-nolisten", "tcp"],
            pass_fds=(write_fd,),
            stdout=subprocess.DEVNULL,

Vague Triggers

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The description includes trigger examples like "get the Sports Inc invoices" and "fetch this month's SI invoices to match against POs" without clearly delimiting where this skill should or should not activate. While domain-related, these are still natural-language requests that could overlap with general accounts-payable conversations unless the platform applies additional routing constraints.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This markdown file describes authentication via an API key and provides a specific email address to request one, but it does not include any warning about treating the key as sensitive, avoiding logging, or storing it securely. Because markdown files should warn about behaviors that could affect privacy or system integrity, the omission is a mild safety gap.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The browser context is created with locale: "en-US", which hard-codes a specific locale for all runs. The file does not indicate that this skill is region-specific or that users can choose a different locale, so this is a natural-language policy concern under the language/locale rule.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The docstring for _fetch says it returns only (bytes, str | None), but the implementation returns data, source_url or url, {...} with a third metadata dictionary. This is an active documentation/code contradiction about the function's interface, not merely omitted detail.

Content

No source excerpt is available for this finding.