Back to skill

Security audit

Medical Device Post-Market Surveillance(医械上市后监管)

Security checks for vulnerabilities and agentic risk

Overview

This skill stays local, but its regulatory advice and bundled audit claims need independent checking.

Use the templates as drafts and independently verify reporting obligations before acting. In particular, the toolkit's 90-day serious-injury deadline conflicts with the general 30-calendar-day manufacturer requirement in [FDA reporting guidance](https://www.fda.gov/medical-devices/postmarket-requirements-devices/mandatory-reporting-requirements-manufacturers-importers-and-device-user-facilities). Save existing verification reports before rerunning the scripts. The bundled audit cites unrelated script names, and the attestation contains a stale SKILL.md checksum; neither should be treated as independent assurance.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • 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 (8)

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: file_read, file_write, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · verify/pms_quality_test.py (reported line 50)May include surrounding context.

python
def check_tools():
    items = []
    try:
        r = subprocess.run([PYTHON, TOOL, "obligations", "--region", "us"], capture_output=True, text=True, timeout=60)
        out = r.stdout or ""
        items.append({"name": "obligations 命令执行", "pass": r.returncode == 0 and "21 CFR 803" in out})
        r2 = subprocess.run([PYTHON, TOOL, "report", "--region", "us"], capture_output=True, text=True, timeout=60)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · verify/pms_quality_test.py (reported line 53)May include surrounding context.

python
r = subprocess.run([PYTHON, TOOL, "obligations", "--region", "us"], capture_output=True, text=True, timeout=60)
        out = r.stdout or ""
        items.append({"name": "obligations 命令执行", "pass": r.returncode == 0 and "21 CFR 803" in out})
        r2 = subprocess.run([PYTHON, TOOL, "report", "--region", "us"], capture_output=True, text=True, timeout=60)
        out2 = r2.stdout or ""
        items.append({"name": "report 命令执行", "pass": r2.returncode == 0 and "30 日历日" in out2 and "90 日历日" in out2})
        r3 = subprocess.run([PYTHON, TOOL, "plan"], capture_output=True, text=True, timeout=60)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · verify/pms_quality_test.py (reported line 56)May include surrounding context.

python
r2 = subprocess.run([PYTHON, TOOL, "report", "--region", "us"], capture_output=True, text=True, timeout=60)
        out2 = r2.stdout or ""
        items.append({"name": "report 命令执行", "pass": r2.returncode == 0 and "30 日历日" in out2 and "90 日历日" in out2})
        r3 = subprocess.run([PYTHON, TOOL, "plan"], capture_output=True, text=True, timeout=60)
        items.append({"name": "plan 命令执行", "pass": r3.returncode == 0 and "PMS 计划" in (r3.stdout or "")})
        r4 = subprocess.run([PYTHON, TOOL, "psur", "--class", "IIb"], capture_output=True, text=True, timeout=60)
        items.append({"name": "psur 命令执行", "pass": r4.returncode == 0 and "2 年" in (r4.stdout or "")})

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · verify/pms_quality_test.py (reported line 58)May include surrounding context.

python
items.append({"name": "report 命令执行", "pass": r2.returncode == 0 and "30 日历日" in out2 and "90 日历日" in out2})
        r3 = subprocess.run([PYTHON, TOOL, "plan"], capture_output=True, text=True, timeout=60)
        items.append({"name": "plan 命令执行", "pass": r3.returncode == 0 and "PMS 计划" in (r3.stdout or "")})
        r4 = subprocess.run([PYTHON, TOOL, "psur", "--class", "IIb"], capture_output=True, text=True, timeout=60)
        items.append({"name": "psur 命令执行", "pass": r4.returncode == 0 and "2 年" in (r4.stdout or "")})
        r5 = subprocess.run([PYTHON, TOOL, "recall"], capture_output=True, text=True, timeout=60)
        items.append({"name": "recall 命令执行", "pass": r5.returncode == 0 and "FSCA" in (r5.stdout or "")})

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · verify/pms_quality_test.py (reported line 60)May include surrounding context.

python
items.append({"name": "plan 命令执行", "pass": r3.returncode == 0 and "PMS 计划" in (r3.stdout or "")})
        r4 = subprocess.run([PYTHON, TOOL, "psur", "--class", "IIb"], capture_output=True, text=True, timeout=60)
        items.append({"name": "psur 命令执行", "pass": r4.returncode == 0 and "2 年" in (r4.stdout or "")})
        r5 = subprocess.run([PYTHON, TOOL, "recall"], capture_output=True, text=True, timeout=60)
        items.append({"name": "recall 命令执行", "pass": r5.returncode == 0 and "FSCA" in (r5.stdout or "")})
    except Exception as e:
        items = [{"name": f"执行失败: {e}", "pass": False}]

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · verify/pms_quality_test.py (reported line 72)May include surrounding context.

python
items = []
    for region, expects in cases:
        try:
            r = subprocess.run([PYTHON, TOOL, "report", "--region", region], capture_output=True, text=True, timeout=60)
            ok = r.returncode == 0 and any(e in (r.stdout or "") for e in expects)
            items.append({"name": f"report({region})→{expects[0]}", "pass": ok})
        except Exception as e:

The verifier writes security_results.json without disclosing that it will overwrite an existing report.

Low
Category
Output Handling
Confidence
88% confidence
Finding

The script creates the verification directory and opens security_results.json in write mode, replacing any existing contents. Its docstring and console output describe verification and scores but do not disclose this persistent file write or overwrite behavior.

Content

No source excerpt is available for this finding.