Back to skill

Security audit

AI Running Coach

Security checks for vulnerabilities and agentic risk

Overview

This Chinese-language running coach skill is coherent and locally scoped, with ordinary coaching and file-parsing risks but no hidden access, persistence, or exfiltration behavior found.

Reasonable to install for Chinese-language running plans and activity summaries. Use it with your own TCX/GPX files or trusted files, avoid very large or untrusted XML uploads, and treat training, injury, caffeine, salt, and fueling advice as general guidance rather than medical advice.

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/analyze_run.py:17
Finding
Unbounded Parsing of User-Supplied XML Files<![CDATA[ ## Vulnerability Details **File Location**: `scripts/analyze_run.py`, lines 17-18 and 58-59 **Vulnerability Type**: Unrestricted XML resource consumption **Risk Level**: Medium ### Vulnerable Code ```python def parse_gpx(file_path): """Parse a GPX file.""" try: tree = ET.parse(file_path) root = tree.getroot() ``` ```python def parse_tcx(file_path): """Parse a TCX file.""" try: tree = ET.parse(file_path) root = tree.getroot() ``` ### Technical Analysis The documented workflow invokes `analyze_run.py` on TCX or GPX files supplied by users. Both parsing functions pass the input directly to `xml.etree.ElementTree.parse()` without first enforcing limits on file size, XML nesting, element count, track-point count, memory consumption, or processing time. `ElementTree.parse()` constructs an in-memory representation of the XML document. An attacker can therefore provide an unusually large or deeply structured GPX or TCX file that consumes excessive memory or CPU while being parsed or traversed. The subsequent loops over tracks, segments, laps, and track points can further amplify processing costs. This finding concerns resource exhaustion. The reviewed code does not establish an arbitrary-code-execution or data-exfiltration path through the XML parser. ### Attack Path 1. An attacker creates a `.gpx` or `.tcx` file containing a very large number of nested elements or track points. 2. The attacker provides the file for analysis. 3. Following the workflow in `SKILL.md`, the Agent executes: ```bash python scripts/analyze_run.py attacker-supplied.gpx --output json ``` 4. `parse_gpx()` or `parse_tcx()` calls `ET.parse()` on the unrestricted file. 5. The parser builds the XML tree in memory, after which the script iterates through its elements. 6. Excessive memory or CPU consumption can stall the process, terminate it through an out-of-memory condition, or disrupt the surrounding Agent session. ### ...[truncated 518 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Enforce an input-size limit before parsing.** Inspect the file size with `os.path.getsize()` and reject files exceeding a conservative application-specific threshold. 2. **Use a hardened XML parser.** Replace the standard parser with `defusedxml.ElementTree` to gain safer handling of hostile XML constructs: ```python from defusedxml import ElementTree as ET ``` 3. **Apply structural limits.** Prefer streaming parsing with `iterparse()` and abort when limits are exceeded, including: - Maximum element count - Maximum nesting depth - Maximum number of activities, laps, tracks, or track points - Maximum text and attribute lengths 4. **Reject dangerous or unnecessary XML constructs.** Explicitly reject documents containing DTD or entity declarations when they are not required for valid GPX or TCX processing. 5. **Constrain execution resources.** Run file analysis with memory and CPU limits and, where supported, a processing timeout. Perform parsing in an isolated worker so a malformed file cannot terminate the primary Agent process. 6. **Validate expected document structure.** Confirm that the root element and namespace match supported GPX or TCX formats before processing the full document. 7. **Return controlled errors.** Catch resource-limit and hardened-parser exceptions and report a generic invalid-or-oversized-file error without exposing unnecessary host details. ]]>
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • 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 (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding
描述把技能定位为专业跑步教练,主能力应是训练指导与多类教练建议;而代码仅实现了本地 TCX/GPX 文件解析和基础跑步数据汇总,主用途明显更窄,属于数据分析工具而非完整教练系统。虽然描述中包含“分析跑步数据(TCX/GPX)”,这部分与代码部分一致,但大量核心宣称能力完全未在代码中体现,且 GPX 支持也主要停留在解析层面,没有在分析结果中充分使用。因此描述与实际行为存在实质性不匹配。

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The manifest description and the document content are entirely presented in Chinese, framing the skill as operating in that language without any opt-in or alternative language handling. Under the policy, a skill should not force a specific language unless it offers user choice or clearly documents a justified locale-specific constraint.

Vague Triggers

Medium
Confidence
89% confidence
Finding
Broad trigger conditions can cause the skill to activate on ordinary running-related conversation even when the user did not intend to invoke it. That can lead to inappropriate handling of user inputs, unnecessary processing of uploaded files, or accidental execution of referenced workflows in a larger agent environment.

Vague Triggers

Medium
Confidence
84% confidence
Finding
The training-question trigger is underspecified and could match a wide range of generic health, injury, or sports questions. In agent systems, ambiguous activation increases the chance of the skill taking over conversations outside its safe domain and giving overconfident advice without proper constraints.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The file gives prescriptive fueling, caffeine, and salt-pill guidance for marathon racing without warning that needs vary by body size, medical conditions, GI tolerance, medications, heat, and prior practice. In a coaching skill, users may follow this advice as authoritative, which can contribute to overhydration, GI distress, electrolyte imbalance, or unsafe supplement use.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The document advises runners to continue through distress states such as 'hitting the wall,' side pain, and cramping, but provides no explicit red-flag criteria for stopping or seeking medical attention. In endurance events, symptoms like severe cramping, dizziness, chest pain, confusion, collapse, breathing difficulty, or worsening pain can indicate dangerous conditions, and omission of stop/seek-help guidance increases harm risk.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The entire markdown file is written in Chinese and does not offer an alternative language, translation option, or any indication that the locale constraint is intentional and justified. Under the policy rule for natural-language violations, forcing a specific language without user opt-in can be a locale-policy issue.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The entire document is written in Chinese and does not indicate that users may choose another language or that the content is intentionally limited to a Chinese-speaking or region-specific audience. Under the policy, a skill that effectively enforces a language/locale without opt-in can be a natural-language policy violation.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
This code file contains user-facing natural-language descriptions and output strings in Chinese only, beginning with the module docstring and continuing through CLI help text. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly documented and justified.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
The entire markdown template uses Chinese headings and field labels, which imposes a specific language on users. Under the policy criteria, a fixed language is a natural-language policy concern when the file does not offer user opt-in or explain that the skill is intentionally region- or locale-specific.

Natural-Language Policy Violations

Low
Confidence
92% confidence
Finding
A natural-language policy issue applies here because the skill content forces a specific language for all users and does not present any opt-in or alternative language option. The file does not document that the Chinese-only format is required for a specific region or audience.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
The module docstring and all user-facing CLI messages are written only in Chinese, which imposes a specific language on users without any opt-in or alternative locale support. The policy explicitly calls out language or locale constraints as findings when the skill does not offer user choice.

Natural-Language Policy Violations

Low
Confidence
94% confidence
Finding
SQP-3 applies to all file types and covers language/locale policy violations. The module docstring, CLI description, argument help text, and output strings are all Chinese-only, which effectively forces a specific language without user opt-in or an explanation that this is a region-specific tool.

Static analysis

No suspicious patterns detected.