Back to skill

Security audit

Work Injury Claim

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a legitimate work-injury claim helper, but it handles sensitive legal, medical, identity, and employment data without enough privacy or secure-output controls.

Install only if you are comfortable handling sensitive claim data locally. Avoid putting full ID numbers, bank details, complete medical records, or private documents into chat unless necessary; prefer redacted drafts. Generate files only into a private folder, review them before sharing, verify current local rules with 12333 or a qualified lawyer, and do not rely on its compensation amounts or legal citations as final 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/generate_injury_claim_docs.py:275
Finding

Unprotected Handling and Storage of Sensitive Personal and Medical Data

Content
View full analysis

Vulnerability Details

File Location: scripts/generate_injury_claim_docs.py:275-279, scripts/generate_injury_claim_docs.py:541, and scripts/generate_injury_claim_docs.py:581-594
Vulnerability Type: Plaintext sensitive-data exposure through command-line arguments and files with default permissions
Risk Level: Medium

Complete Code Snippet

python
身份证号:{case.get("applicant_id", "(待填)")}

住址:{case.get("applicant_address", "(待填)")}

电话:{case.get("applicant_phone", "(待填)")}
python
parser.add_argument("--applicant-id", help="身份证号")
python
# Ensure that the output directory exists
os.makedirs(args.output_dir, exist_ok=True)

# Generate documents
app_content = generate_recognition_application(case)
comp_content = generate_compensation_table(case)
doc_content = generate_document_checklist(case)

# Construct output paths
app_path = os.path.join(args.output_dir, "工伤认定申请书.md")
comp_path = os.path.join(args.output_dir, "工伤待遇计算表.md")
doc_path = os.path.join(args.output_dir, "索赔材料清单.md")

with open(app_path, "w", encoding="utf-8") as f:
    f.write(app_content)

Technical Analysis

The generator processes government identification numbers, residential addresses, telephone numbers, medical diagnoses, employment details, and injury-claim information. It permits at least the applicant's government ID to be supplied as a command-line argument and embeds the sensitive values directly in plaintext Markdown documents.

Sensitive command-line arguments may be exposed through shell history, process inspection facilities, terminal logs, or command auditing systems. The generated output directory is created without an explicit restrictive mode, and files are opened without explicitly enforcing owner-only permissions. Their effective permissions therefore depend on the process umask and the permissions of an existing destination directory.

On a shared system or under a permissiv ...[truncated 1881 chars]

Remediation
View remediation

Remediation Suggestions

  1. Avoid accepting government IDs and other sensitive values through command-line arguments. Prefer a protected JSON file, standard input, or an interactive prompt that does not retain values in shell history.
  2. Create new output directories with owner-only permissions such as 0700, and verify that existing directories are not accessible to unintended users.
  3. Create output files with mode 0600, using secure low-level creation flags where appropriate, rather than relying only on the process umask.
  4. Validate destination paths before writing. Refuse unsafe shared destinations and symbolic-link output targets where an untrusted local user could redirect or observe output.
  5. Warn users not to place generated documents in public, temporary, shared, source-controlled, or automatically synchronized directories.
  6. Add a redacted-output option that masks government IDs, telephone numbers, addresses, and medical details unless full values are explicitly required.
  7. Document retention and secure-deletion expectations for configuration files and generated documents.
  8. Add automated tests that verify owner-only permissions for newly created directories and files.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

该描述与代码存在部分重合:代码确实能生成索赔文档、材料清单,并计算部分工伤待遇项目,属于工伤索赔辅助的一部分。但描述显著夸大了能力范围。代码没有联网、数据库或规则引擎来做全国地区规则查询;地区标准仅覆盖有限城市/省份且使用参考值。所谓“工伤情形研判”在代码中并未实现,只是根据已给定injury_type填充模板。对因工死亡、供养亲属抚恤金、职业病等复杂场景,也主要停留在模板/清单层面,缺少对应的完整待遇计算与流程处理。因此,实际行为是“有限范围的工伤索赔文档生成与部分待遇测算工具”,与“全国全流程辅助技能”这一声明相比存在实质性能力不匹配。

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill asks users to provide employer identity, injury details, wage information, and upload medical records and legal documents, then states those materials will be analyzed, but it lacks a clear privacy, retention, redaction, and consent warning. Because this workflow handles highly sensitive personal, employment, and medical information, unclear data-handling practices materially increase the risk of privacy harm or overcollection.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The entire skill description, examples, and usage context are written only in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to Chinese-language use. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill instructs use of a document-generation script and references reading multiple local files, which implies file read/write capability, but it does not declare any tool scope or allowed-tools boundary. In an agent environment, undeclared file access weakens least-privilege controls and can lead to unexpected handling of sensitive legal and medical case data.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The description says to use the skill whenever the user mentions a long list of broad topics such as work-injury recognition, compensation, occupational disease, or disability subsidies, but it does not define exclusions or negative examples. This can cause unintended invocation during general legal, HR, insurance, or news discussions that merely mention these terms.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest description is written only in Chinese and the skill appears to assume Chinese-language interaction without stating whether other languages are supported. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill offers one-click generation of claim documents containing detailed case facts, employer information, medical status, and compensation calculations, but it does not warn users that the output files themselves are sensitive artifacts. In a file-writing agent context, this can expose personal data through insecure storage locations, accidental sharing, or persistence beyond the user’s expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document instructs users to collect a large volume of highly sensitive personal, medical, employment, family, and financial records, but provides no guidance on data minimization, redaction, secure storage, transmission, retention, or consent. In a skill that helps assemble claim packets, this omission can lead users or downstream systems to overshare and mishandle protected information, increasing privacy, identity theft, and unauthorized disclosure risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

这是一个适用于所有文件类型的自然语言策略问题。文件顶部说明、参数帮助和生成内容均默认并强制为中文,但未向用户提供语言/locale 选择,也未明确声明该脚本仅限中文法务场景使用,因此存在未获用户选择即施加特定语言/locale 的情况。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation says users should pass --resigned, but the code actually registers --resided. As a result, cases involving resignation/termination may be processed incorrectly, causing omission of compensation items tied to解除/终止劳动关系 and producing legally misleading claim documents or payout calculations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The template states it will cite the corresponding statutory article/item, but the code only fills the item number for injury_type=1 and leaves other item references blank or incorrect. In a legal-claims skill, this can generate formally defective or misleading application documents that weaken a claimant's submission or require rework under time-sensitive filing deadlines.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The entire document is written only in Chinese and does not indicate that users may request another language or that the content is intentionally limited to Chinese-speaking users. Under the language/locale policy, a fixed language without opt-in or justification is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This markdown file is written entirely in Chinese and presents the guidance as the default form without indicating that another language or locale can be used. Under the policy, forcing a specific language without user opt-in can be considered a natural-language policy violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

SQP-3 适用于所有文件类型,要求识别自然语言中的语言或 locale 政策违规。该文件标题及全文均固定为中文,且未见任何关于仅面向中文用户、地区限定适用,或可选择其他语言的说明。

Content

No source excerpt is available for this finding.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/generate_injury_claim_docs.py (reported line 571)May include surrounding context.

python
else:
        case = {}
        for key in vars(args):
            val = getattr(args, key)
            if val is not None and key not in ("config", "output_dir"):
                if key in ("monthly_salary", "disability_level", "hospital_days"):
                    case[key] = int(val)