Back to skill

Security audit

medical-training-report

Security checks for vulnerabilities and agentic risk

Overview

This looks like a legitimate medical-training report generator, but it handles participant data and local files with weak privacy and scoping guidance.

Install only if you are comfortable processing medical-training materials in this environment. Before using it, redact patient data and unnecessary personal identifiers, confirm you are authorized to share trainee names/scores/feedback, avoid exposing sensitive local paths where possible, and use a controlled Python environment with pinned dependencies.

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

Warning
Location
scripts/generate_report.py:56
Finding

Unpinned Third-Party Dependency Installation Guidance

Content
View full analysis

Vulnerability Details

File Location: scripts/generate_report.py:56-59, scripts/generate_report.py:147-150, and scripts/generate_report.py:236-239
Vulnerability Type: Unpinned dependency installation from the environment's configured package index
Risk Level: Medium

Vulnerable Code

The following pattern appears in the Excel score, quiz, and feedback parsing functions:

python
try:
    import openpyxl
except ImportError:
    print("Error: the openpyxl library is required. Run: pip install openpyxl")
    return []

The feedback parser uses the equivalent return type:

python
try:
    import openpyxl
except ImportError:
    print("Error: the openpyxl library is required. Run: pip install openpyxl")
    return {}

Technical Analysis

When openpyxl is unavailable, the script directs the operator to install it using an unconstrained pip install openpyxl command. The project does not provide a pinned dependency manifest, lockfile, package hash, or explicitly approved package index.

Consequently, the installed artifact depends on mutable package-index state and the local pip configuration. Although openpyxl is a legitimate package, this installation workflow does not guarantee that a previously reviewed version is installed. A compromised package release, compromised index, malicious package mirror, or attacker-controlled pip configuration could cause untrusted code to enter the runtime environment.

Exploitation is not automatic from invoking the report generator: it requires the dependency to be missing and an operator or automation layer to execute the displayed installation command. If those conditions are met, malicious dependency code could execute during package installation or when the package is subsequently imported.

Attack Path

  1. The report generator receives input that requires Excel score, quiz, or feedback processing.
  2. The Python environment do ...[truncated 1278 chars]
Remediation
View remediation

Remediation Suggestions

  1. Declare all runtime dependencies, including openpyxl and python-docx, in a centrally maintained dependency manifest.

  2. Pin each dependency to a reviewed version rather than allowing unconstrained resolution.

  3. Use a hash-verified requirements file or a lockfile. For example:

    text
    openpyxl==<reviewed-version> --hash=sha256:<verified-hash>
    python-docx==<reviewed-version> --hash=sha256:<verified-hash>
    
  4. Install dependencies only from an approved internal repository or an explicitly configured trusted index.

  5. Configure automated dependency scanning and a controlled process for reviewing version updates.

  6. Remove ad hoc installation commands from runtime error messages. Replace them with a neutral message that refers operators to the project's controlled setup documentation.

  7. Run dependency installation and report generation in an isolated virtual environment or container with only the filesystem permissions required for input and output files.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (14)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `assets/template.docx` | 原始模板文档 |

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/template.docx!/word/theme/theme1.xml (reported line 2)May include surrounding context.

text
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office 主题​​"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="44546A"/></a:dk2><a:lt2><a:srgbClr val="E7E6E6"/></a:lt2><a:accent1><a:srgbClr val="5B9BD5"/></a:accent1><a:accent2><a:srgbClr val="ED7D31"/></a:accent2><a:accent3><a:srgbClr val="A5A5A5"/></a:accent3><a:accent4><a:srgbClr val="FFC000"/></a:accent4><a:accent5><a:srgbClr val="4472C4"/></a:accent5><a:accent6><a:srgbClr val="70AD47"/></a:accent6><a:hlink><a:srgbClr val="0563C1"/></a:hlink><a:folHlink><a:srgbClr val="954F72"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="等线 Light" panose="020F0302020204030204"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="游ゴシック Light"/><a:font script="Hang" typeface="맑은 고딕"/><a:font script="Hans" typeface="等线 Light"/><a:font script="Hant" typeface="新細明體"/><a:font script="Arab" typeface="Times New Roman"/><a:font script="Hebr" typeface="Times New Roman"/><a:font script="Thai" typeface="Angsana New"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="MoolBoran"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font scri
...[truncated 26 chars]

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
81% confidence
Finding

The skill instructs the agent to read and process local files such as Excel sheets, PPT photos,签到表 and other materials, but it does not declare an explicit tool scope like allowed-tools or permissions. This creates an authorization ambiguity where the runtime may permit broader file access than users expect, increasing the risk of unintended local file reads during report generation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
79% confidence
Finding

The description and prescribed first-turn prompt are entirely in Chinese and instruct a fixed interaction style, but the file does not state that the skill is region-specific or offer an opt-in language choice. Under the policy, forcing a specific language without user choice can be a natural-language policy violation unless clearly justified.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger conditions include generic phrases like '写活动报告', '培训报告', and '生成报告', which can match many ordinary report-writing requests unrelated to this medical-training workflow. Over-broad activation can cause the wrong skill to take over a conversation, prompting for unnecessary sensitive documents and steering the agent into inappropriate data collection.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill explicitly requests签到表、成绩表、QUIZ、反馈打分、学员姓名、医院 and other participant performance data, which may include personal and potentially sensitive professional information. Without any privacy notice, minimization guidance, consent check, or warning to review identifiers before processing, the workflow encourages unnecessary collection and automated handling of personal data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire template library and generation guidance are written exclusively in Chinese and instruct the AI to generate course descriptions and summaries in that language, but there is no indication that users may choose another language. Under the policy, a forced language/locale without user opt-in is a natural-language policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The template explicitly solicits sensitive personal and professional data, including participant names, hospitals, scores, and in some modes full meeting transcripts, yet provides no data-minimization, consent, retention, or redaction guidance. In a medical-training context, these materials can contain personal data and potentially incidental patient or clinician information, so collecting them broadly into an AI workflow materially increases privacy and confidentiality risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code saves a generated report to disk, and elsewhere in the file the report clearly includes names, provinces, hospitals, scores, and feedback-derived summary data. Although the write itself is expected for a report generator, there is no disclosure in code comments, prompts, or output messaging warning that sensitive trainee information will be written into the output document.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The condition “用户发送培训材料:海报/PPT照片/Excel/日程/签到表/成绩表” describes very common file types that could appear in many unrelated contexts. Without explicit domain constraints or non-trigger examples, the activation boundary is unclear and may cause the skill to activate when users merely share generic training documents.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
67% confidence
Finding

All user-facing instructions and examples are presented only in Chinese, and the template does not indicate that the user may choose another language or that the skill is intentionally limited to a Chinese-language workflow. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy concern unless the locale restriction is explicit and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The template asks users to provide local filesystem paths such as Windows drive locations for scores, quiz files, and photo folders. While not code execution by itself, this unnecessarily exposes host environment details such as usernames, directory structure, and organizational storage conventions, which can aid follow-on social engineering or information disclosure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This markdown file is entirely prescriptive in Chinese, including fixed Chinese section titles and formatting requirements, which implies the generated skill output must use a specific language/locale. Under the policy, forcing a specific language without offering user choice can be a natural-language policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The file’s natural-language interface elements, including the module docstring and argparse description/help strings, are entirely in Chinese. Under the stated policy, forcing a specific language without opt-in can be a locale policy violation when no alternative language choice or justification is provided.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.