Back to skill

Security audit

base-station-antenna-monitor

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-built for patent monitoring, but its generated HTML report can include unescaped patent data and unsafe links that may run browser script when opened.

Review before installing or running. Use only trusted patent data sources, write reports to a controlled directory, and avoid opening generated reports from untrusted input until the HTML escaping, URL validation, rel=noopener, and CSP issues are fixed.

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/run_monitor.py:344
Finding

Stored HTML and Script Injection in Generated Patent Report

Content
View full analysis
{pub_num}' else: pub_num_cell = pub_num rows_html += f""" {i} {pub_num_cell} {title} {assignee}
Remediation
View remediation
str: return html.escape(safe_str(value), quote=True) ``` Escape titles, assignees, publication numbers, dates, status values, summaries, branch names, keywords, company names, and all other data-derived strings. 2. **Strictly validate patent URLs.** Parse URLs with `urllib.parse.urlsplit()` and allow only explicitly approved schemes and, if feasible, approved PatSnap hostnames: ```python from urllib.parse import urlsplit def safe_patent_url(value: str) -> str: value = safe_str(value).strip() parsed = urlsplit(value) if parsed.scheme != "https": return "" if parsed.hostname not in {"analytics.patsnap.com", "www.patsnap.com"}: return "" return html.escape(value, quote=True) ``` Reject `javascript:`, `data:`, `file:`, protocol-relative, malformed, and unexpected URLs. 3. **Harden external links.** Add opener isolation: ```html target="_blank" rel="noopener noreferrer" ``` 4. **Use an auto-escaping template engine.** Replace manual f-string HTML assembly with a template engine such as Jinja2 configured with automatic HTML escaping. Keep URL validation separate because HTML escaping alone does not make a dangerous URL scheme safe. 5. **Add a restrictive Content Security Policy.** Include a policy that blocks inline scripts, event handlers, plugins, and unexpected network destinations. For a self-contained report, a restrictive starting point is: ```html ``` Adjust only those directives demonstrably required by the repor ...[truncated 278 chars]
Vulnerability Patterns
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 44)May include surrounding context.

md
python scripts/run_monitor.py --days 30 --output report.html

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The skill advertises file read/write and environment-related capabilities through its described behavior and execution model, but it does not declare any explicit tool scope such as permissions or allowed-tools. This creates an authorization ambiguity: an agent runtime may grant broader tool access than users expect, increasing the risk of unintended file access, overwriting outputs, or use of sensitive environment-backed credentials during execution.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description states the skill generates a professional HTML report with Chinese technical summaries, which imposes a specific language on the user. The file does not offer any user opt-in, language selection, or justification that the skill must operate only in Chinese for a region-specific compliance reason.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module docstring, CLI description, status messages, and generated HTML are all hard-coded in Chinese, and the HTML explicitly sets lang="zh-CN". There is no user opt-in, language selection, or documentation that this is a region-specific tool, so the file imposes a specific language/locale policy by default.

Content

No source excerpt is available for this finding.

Tainted flow: 'output_path' from os.environ.get (line 885, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
88% confidence
Finding

The script trusts the environment variable EUREKA_PYTHON_OUTPUT_DIR when constructing the output path and then writes the generated HTML report there. In an agent/runtime setting, environment variables are externally influenced inputs; a malicious or misconfigured value can redirect writes to unintended filesystem locations, causing arbitrary file overwrite within the process's permissions.

Content

Scanner excerpt · scripts/run_monitor.py (reported line 887)May include surrounding context.

python
os.makedirs(out_dir, exist_ok=True)
        output_path = os.path.join(out_dir, os.path.basename(args.output))

    with open(output_path, "w", encoding="utf-8") as f:
        f.write(html)
    print(f"[OK] HTML报告已生成: {output_path}")