Back to skill

Security audit

Brickset

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed Brickset API helper that uses a Brickset API key and a fixed Brickset endpoint; its broad raw mode and key handling deserve care but are not hidden or deceptive.

Install only if you are comfortable giving the skill a Brickset API key. Prefer BRICKSET_API_KEY in the environment over passing --api-key on the command line, avoid placing unrelated secrets in workspace .env files, and use raw calls only when you intend to invoke the specific Brickset method and parameters.

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

Warning
Location
scripts/brickset.py:56
Finding

Brickset API Key Exposure Through Command-Line Arguments and URL Query Strings

Content
View full analysis
dict[str, Any]: params: dict[str, Any] = {"apiKey": api_key} if extra_params: for key, value in extra_params.items(): if value is None: continue params[key] = value url = f"{API_BASE}/{method}" headers = {"Accept": "application/json"} try: if post: body = urlencode(params).encode("utf-8") request = Request(url, data=body, headers=headers, method="POST") else: request = Request(f"{url}?{urlencode(params)}", headers=headers, method="GET") ``` ```python parser.add_argument("--api-key", help="Brickset API key. Defaults to BRICKSET_API_KEY env/.env") ``` ### Technical Analysis The CLI accepts a secret API key through the `--api-key` command-line option. Command-line arguments may be retained in shell history and may be visible to local users or monitoring software through process inspection facilities. For requests where `post` is false, `call_api()` places the API key directly in the URL query string. Although the fixed endpoint uses HTTPS, query strings can still be recorded by the destination server, reverse proxies, observability platforms, debugging tools, and URL-based access logs. TLS protects the request in transit but does not prevent either endpoint or authorized intermediary infrastructure from logging the complete URL. The network transmission itself is necessary for the declared Brickset API functionality and is restricted to the hard-coded official HTTPS endpoint: ```python API_BASE = "https://brickset.com/api/v3.asmx" ``` However, exposing the credential through process arguments and request URLs exceeds t ...[truncated 1458 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (6)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/brickset.py (reported line 7)May include surrounding context.

python
Reads BRICKSET_API_KEY from:
1. --api-key
2. environment variable BRICKSET_API_KEY
3. workspace .env in current working directory or one of its parents

Default output is JSON. Use --format text for human-readable summaries.
"""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/brickset.py (reported line 30)May include surrounding context.

python
start = (start or Path.cwd()).resolve()
    candidates = [start, *start.parents]
    for directory in candidates:
        env_path = directory / ".env"
        if env_path.exists():
            values: dict[str, str] = {}
            for raw_line in env_path.read_text(encoding="utf-8").splitlines():

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/brickset.py (reported line 52)May include surrounding context.

python
start = (start or Path.cwd()).resolve()
    candidates = [start, *start.parents]
    for directory in candidates:
        env_path = directory / ".env"
        if env_path.exists():
            values: dict[str, str] = {}
            for raw_line in env_path.read_text(encoding="utf-8").splitlines():

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/brickset.py (reported line 98)May include surrounding context.

python
start = (start or Path.cwd()).resolve()
    candidates = [start, *start.parents]
    for directory in candidates:
        env_path = directory / ".env"
        if env_path.exists():
            values: dict[str, str] = {}
            for raw_line in env_path.read_text(encoding="utf-8").splitlines():

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill exposes capabilities that can access environment variables, read files, and make network requests, but it does not declare any tool scope such as permissions or allowed-tools. In an agent environment, this weakens policy enforcement and increases the chance the skill can be invoked with broader authority than intended, including access to API keys and external endpoints.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The raw subcommand allows the caller to invoke any Brickset API method with arbitrary parameters, which exceeds the declared narrow, human-friendly skill scope and defeats any intended allowlisting. In an agent setting, this broad capability can expose account-specific or higher-risk API operations that were not reviewed, making misuse easier if an upstream prompt or tool caller is untrusted.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.