Back to skill

Security audit

KMB and LWB Bus Arrivals

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it claims: it fetches public KMB bus arrival data, with no evidence of hidden data access, persistence, or destructive behavior.

Before installing, be aware that the skill makes live HTTPS requests to the public KMB API and requires the certifi Python package. For stronger reproducibility, pin certifi to a reviewed version. The reviewed artifacts did not show hidden data collection, destructive actions, or persistent behavior.

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

T08 · Insecure Dependencies

Note
Location
SKILL.md:37
Finding
Unpinned Third-Party Dependency Installation## Vulnerability Details **File Location**: `SKILL.md`, line 37 **Vulnerability Type**: `T08: Insecure Dependencies` **Risk Level**: Low **Vulnerable code snippet**: ```bash # Dependencies: certifi (pip install certifi) ``` The same unpinned installation instruction is duplicated in `README.md`, line 9. ### Technical Analysis The installation documentation instructs users to install `certifi` without pinning a reviewed version or verifying the package artifact with a cryptographic hash. Consequently, the code installed by users can change after this skill has been audited. The package name refers to a legitimate dependency from the default Python package index, and the audit found no evidence that the project intentionally uses a malicious or misspelled package. The weakness is therefore limited to insufficient supply-chain reproducibility and integrity controls. A compromised package release, package-index account, mirror, or dependency resolution environment could cause users to install code that was not part of the reviewed project. ### Attack Path 1. An attacker compromises the package publisher, package index, configured mirror, or dependency resolution environment and makes a malicious or altered `certifi` release available. 2. A user follows the documented `pip install certifi` instruction. 3. `pip` resolves and downloads the uncontrolled current release rather than a specifically reviewed artifact. 4. Malicious package installation logic, if present, executes with the privileges of the user running `pip`. 5. The installed package may subsequently execute when `kmb_bus.py` imports `certifi`. This path depends on a separate supply-chain compromise; it is not directly exploitable solely through the skill's route or stop-name inputs. ### Impact Assessment Successful exploitation could execute code with the privileges of the account that installs or runs the dependency. Depending on those privileges, potentia ...[truncated 386 chars]
Remediation
## Remediation Suggestions - Declare a specific, reviewed `certifi` version in a dependency file rather than recommending an unconstrained installation. - Use a hash-locked requirements file, for example: ```text certifi==REVIEWED_VERSION --hash=sha256:VERIFIED_DISTRIBUTION_HASH ``` - Install with hash enforcement: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` - Generate and retain lock files through a controlled dependency-update process. - Review release notes and package provenance before updating the pinned version. - Keep `SKILL.md` and `README.md` synchronized so both reference the same locked installation procedure. - Avoid recommending privileged or system-wide package installation.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill performs outbound network access to the KMB API but does not declare any explicit permission or allowed-tools scope. This creates a capability mismatch where an agent or reviewer may underestimate what the skill can do, reducing transparency and weakening policy enforcement around external communications.

External Transmission

Medium
Category
Data Exfiltration
Content
import json, sys, time, re, urllib.request, urllib.error, ssl, certifi, functools
from datetime import datetime, timedelta, timezone

BASE = "https://data.etabus.gov.hk/v1/transport/kmb"

# Security: Local rate limiting (10 requests/minute per process)
RATE_LIMIT = 10
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
import json, sys, time, re, urllib.request, urllib.error, ssl, certifi, functools
from datetime import datetime, timedelta, timezone

BASE = "https://data.etabus.gov.hk/v1/transport/kmb"

# Security: Local rate limiting (10 requests/minute per process)
RATE_LIMIT = 10
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
import json, sys, time, re, urllib.request, urllib.error, ssl, certifi, functools
from datetime import datetime, timedelta, timezone

BASE = "https://data.etabus.gov.hk/v1/transport/kmb"

# Security: Local rate limiting (10 requests/minute per process)
RATE_LIMIT = 10
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Intent-Code Divergence

Low
Confidence
98% confidence
Finding
The top-level documentation states an "API call budget (15 calls/invocation)" at L007, while the implemented constant MAX_API_CALLS is set to 100 at L024. This is an active contradiction between documentation and code behavior, not merely an omitted detail.

Static analysis

No suspicious patterns detected.