Back to skill

Security audit

保险责任分析

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for insurance-term analysis, but it can automatically install unpinned packages, fetch arbitrary URLs, and generate unsafe HTML reports from untrusted content.

Install only if you are comfortable running it in an isolated environment. Avoid giving it internal, localhost, or private-network URLs, and do not open generated HTML reports from untrusted inputs in a sensitive browser session. Dependencies should be preinstalled from a locked manifest rather than installed automatically at runtime.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate_report.py:129
Finding

Unescaped Analysis Data Allows Persistent HTML and Script Injection

Content
View full analysis
{item["label"]}{item["value"]}' risk_signals_html = "" for sig in d.get("risk_signals", []): risk_signals_html += f'
{sig}
' dimension_rows += f'''
{d["name"]}
{d["score"]:.1f} {label}
{items_html}
{f'
风险信号
{risk_signals_html}
' if risk_signals_html else ''}
''' # 生成风险提示 risk_cards = "" ...[truncated 3604 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/web_scrape.py:52
Finding

Unrestricted URL Fetching Enables Server-Side Request Forgery

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/ocr_extract.py:42
Finding

Automatic Installation of Unpinned Dependencies Creates a Supply-Chain Execution Risk

Content
View full analysis
=2.7", "paddlepaddle>=2.6", "-i", "https://pypi.tuna.tsinghua.edu.cn/simple/", "--trusted-host", "pypi.tuna.tsinghua.edu.cn"], stdout=sys.stderr, stderr=sys.stderr) return extract_with_paddleocr(image_path) ``` ```python except ImportError: print("[提示] pytesseract 未安装。正在尝试安装...", file=sys.stderr) import subprocess subprocess.check_call( [sys.executable, "-m", "pip", "install", "pytesseract", "Pillow", "-i", "https://pypi.tuna.tsinghua.edu.cn/simple/", "--trusted-host", "pypi.tuna.tsinghua.edu.cn"], stdout=sys.stderr, stderr=sys.stderr) print("[提示] 还需要安装 Tesseract OCR 引擎,请访问 https://github.com/UB-Mannheim/tesseract/wiki 下载安装", file=sys.stderr) return extract_with_tesseract(image_path) ``` From `scripts/web_scrape.py`: ```python except ImportError as e: missing = str(e).split("'")[1] if "'" in str(e) else "未知模块" print(f"[提示] {missing} 未安装。正在尝试安装...", file=sys.stderr) import subprocess install_cmd = [] if 'requests' in missing or 'bs4' in missing or 'beautifulsoup4' in missing: install_cmd = ["pip", "install", "requests", "beautifulsoup4", "-i", "https://pypi.tuna.tsinghua.edu.cn/simple/", "--trusted-host", "pypi.tuna.tsinghua.edu.cn"] if install_cmd: subprocess.check_call( [sys.execut ...[truncated 2241 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (19)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是端到端“保险责任分析”技能,核心能力应包括输入获取(图片/文本/链接)、内容识别、结构化提取、分析评分和可视化输出。而代码片段的实际职责明显更窄,只负责把外部已经准备好的分析结果JSON渲染成HTML页面。虽然“生成交互式HTML可视化分析报告”与声明中的最后一步一致,但缺失了声明中最关键的大部分分析能力,因此该代码片段与声明用途存在实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个完整的保险条款分析技能,而提供的代码片段只是一个OCR提取脚本,主要作用是从图片中识别文字。虽然OCR可作为上游支撑步骤,与“用户上传保险条款图片”这一输入形式部分相关,但它不足以覆盖声明中的核心能力。代码的主要目的与声明的主要目的存在明显差异:声明强调内容理解、结构化分析、评分与报告生成,代码则仅做文字识别与文件输出。此外,代码只接受本地图片路径,不支持声明中的粘贴文本或产品链接输入。因此应判定为描述与实际行为不匹配。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill declares no tool scope while instructing use of shell, network access, file reads, and file writes. That creates excessive implicit capability: if invoked, the agent may execute OCR/scraping/report-generation commands and access local or remote resources without explicit least-privilege boundaries, increasing risk from prompt injection, unsafe URLs, or unintended file operations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Broad, everyday trigger phrases can cause the skill to activate unintentionally in normal conversation. In this skill, accidental activation is more dangerous because activation can lead to shell commands, OCR, network scraping, and report generation on untrusted user-supplied content or URLs.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger_words list contains vague phrases such as casual requests about insurance, without constraints on context. This expands the attack surface by making it easier for benign conversation or adversarial phrasing to invoke a tool-using skill that can read files, fetch URLs, and run scripts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file contains all user-facing instructions in Chinese and does not indicate that the user can choose another language. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The generated HTML explicitly sets lang="zh-CN", and the script’s user-facing strings and output are entirely in Chinese. This imposes a specific language/locale on all users without any opt-in, language selection, or documented region-specific justification, which matches the natural-language locale policy violation criteria.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

An OCR extraction script should process local images, but this code reaches out to an external package mirror and installs software during normal execution. That materially broadens the skill's privileges and attack surface beyond its stated purpose, making compromise of the mirror, package, or environment far more damaging.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script installs PaddleOCR-related packages automatically without any explicit user confirmation. This is unsafe because it silently changes the host environment, may violate least-privilege and change-control expectations, and can expose users to supply-chain risks they did not consent to.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
95% confidence
Finding

The script invokes pip at runtime to install packages from an external mirror whenever PaddleOCR is missing. This gives a document-processing skill unnecessary package-management and network-reach capability, and executes unpinned third-party code in the current environment, creating a supply-chain and unexpected code-execution risk.

Content

Scanner excerpt · scripts/ocr_extract.py (reported line 43)May include surrounding context.

python
except ImportError:
        print("[提示] paddleocr 未安装。正在尝试安装...", file=sys.stderr)
        import subprocess
        subprocess.check_call(
            [sys.executable, "-m", "pip", "install",
             "paddleocr>=2.7", "paddlepaddle>=2.6",
             "-i", "https://pypi.tuna.tsinghua.edu.cn/simple/",

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The fallback path repeats the same unjustified capability expansion by installing pytesseract and Pillow from an external mirror during execution. Because this occurs on error-handling/import failure paths, it may be triggered unexpectedly and still leads to remote code execution through package installation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The Tesseract-related fallback similarly performs silent dependency installation without prior approval. In a skill meant for insurance OCR analysis, this behavior is unrelated to the core task and increases operational and security risk by unexpectedly modifying the execution environment.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
95% confidence
Finding

The Tesseract fallback also runs pip automatically at runtime to fetch Python packages from an external mirror. Even though the subprocess arguments are not shell-injected, the dangerous behavior is that an OCR helper can modify the environment and execute code from remote packages without prior approval.

Content

Scanner excerpt · scripts/ocr_extract.py (reported line 71)May include surrounding context.

python
except ImportError:
        print("[提示] pytesseract 未安装。正在尝试安装...", file=sys.stderr)
        import subprocess
        subprocess.check_call(
            [sys.executable, "-m", "pip", "install",
             "pytesseract", "Pillow",
             "-i", "https://pypi.tuna.tsinghua.edu.cn/simple/",

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Auto-installing Python packages is not required to fulfill the stated purpose of analyzing insurance terms and introduces supply-chain risk. Installing packages at runtime may execute unreviewed code, change the environment persistently, and create unexpected network access paths that are disproportionate to the skill’s advertised functionality.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script modifies the local environment by launching pip automatically and does so without prior warning, confirmation, or an opt-in flag. In an agent skill context, hidden environment changes are especially risky because users expect document analysis, not package management or execution of installer code from external sources.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
95% confidence
Finding

The code automatically executes pip via a subprocess when imports fail, causing the skill to modify the runtime environment and run additional code from external packages without explicit user approval. Even though the package names are hard-coded, this expands the trust boundary to package indexes and installation-time code, which is unnecessary for simple insurance-page scraping and can be abused in compromised or untrusted environments.

Content

Scanner excerpt · scripts/web_scrape.py (reported line 91)May include surrounding context.

python
"-i", "https://pypi.tuna.tsinghua.edu.cn/simple/",
                          "--trusted-host", "pypi.tuna.tsinghua.edu.cn"]
        if install_cmd:
            subprocess.check_call(
                [sys.executable] + install_cmd[1:],
                stdout=sys.stderr, stderr=sys.stderr)
            return scrape_with_requests(url)

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file presents all instructions and reference patterns exclusively in Chinese, and it does not indicate that the user can choose another language or opt in to a Chinese-only experience. Under the policy scope for natural-language violations, forcing a specific language without user choice can be considered a locale/language policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This reference file presents all instructions and terminology exclusively in Chinese, and there is no natural-language indication that the user can choose another language or that the Chinese-only scope is intentionally limited to a specific locale. Under the policy rule for language/locale constraints, forcing a single language without opt-in can be a policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The Accept-Language header forces requests to prefer zh-CN/zh, which is a natural-language locale policy choice embedded in code. There is no user opt-in, configuration option, or justification that this skill is intentionally region- or language-specific at runtime.

Content

No source excerpt is available for this finding.