Back to skill

Security audit

风险评估技能

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed Chinese ISO31000 risk-assessment helper, but its Excel parser can read and print arbitrary local workbook paths without size or scope limits.

Install only if you are comfortable using a Chinese-language workflow and sharing the operational details needed for a risk assessment. Treat Excel parsing carefully: provide only intended uploaded workbooks, prefer a specific sheet, avoid very large files, and review generated reports before saving because they may contain confidential business information.

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/excel_parser.py:25
Finding

Unrestricted Local Workbook Access and Unbounded Excel Parsing

Content
View full analysis

Vulnerability Details

File Location: scripts/excel_parser.py, lines 25-32, 46-64, and 96-121
Vulnerability Type: Unrestricted file access and resource exhaustion
Risk Level: Medium

Vulnerable Code

python
if sheet_name:
    df = pd.read_excel(file_path, sheet_name=sheet_name)
    sheets_data = {sheet_name: df}
else:
    sheets_data = pd.read_excel(file_path, sheet_name=None)
python
for sheet_name, df in sheets_data.items():
    sheet_info = {
        "name": sheet_name,
        "total_rows": len(df),
        "total_columns": len(df.columns),
        "columns": list(df.columns),
        "data": []
    }

    for idx, row in df.iterrows():
        row_dict = {}
        for col in df.columns:
            value = row[col]
            if pd.isna(value):
                row_dict[col] = None
            else:
                row_dict[col] = str(value)
        sheet_info["data"].append(row_dict)

    result["sheets"][sheet_name] = sheet_info
python
args = parser.parse_args()

result = parse_excel(args.file_path, args.sheet_name)

if args.identify_risks and result["status"] == "success":
    risk_sheets = identify_risk_data(result)
    result["risk_sheets"] = risk_sheets
    result["risk_sheet_count"] = len(risk_sheets)

print(json.dumps(result, ensure_ascii=False, indent=2))

Technical Analysis

The --file-path argument is passed directly to pandas.read_excel() without resolving and validating the path against an authorized upload directory. The implementation does not reject absolute paths, parent-directory traversal, or symbolic links. Consequently, the parser can access any compatible workbook readable by the operating-system account running the Skill if its path is known or can be inferred.

When no sheet is specified, sheet_name=None causes pandas to load every worksheet. The parser then iterates through every row and column, ...[truncated 1728 chars]

Remediation
View remediation

Remediation Suggestions

  1. Resolve the supplied path with Path.resolve() and require it to remain within a dedicated, trusted upload directory.
  2. Reject absolute paths, parent-directory traversal, symbolic links, non-regular files, and files that were not registered as uploads for the current session.
  3. Allowlist supported workbook extensions and verify the file type independently of the filename.
  4. Enforce a maximum file size before calling pandas.
  5. Set limits for worksheet count, rows, columns, total cells, processing time, memory use, and serialized output size.
  6. Require an explicit worksheet selection for large or multi-sheet files, or inspect workbook metadata before loading worksheet contents.
  7. Return only the columns and rows required for risk analysis instead of emitting the entire workbook.
  8. Run parsing in an isolated, least-privileged worker with filesystem restrictions and resource quotas.
  9. Replace raw exception details returned to users with a generic error while recording diagnostic details only in protected logs.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

声明描述的是面向用户的风险管理辅助技能,核心应是围绕 ISO31000 的交互式评估与建议生成。但代码并未实现任何问答、合规判断、风险评分、应对策略生成或报告生成逻辑。它只是在本地解析 Excel 文件,并根据列名中的关键词识别可能与风险相关的 sheet。这属于明显不同的主要用途。此外,代码具有文件读取/解析 Excel 的具体能力,而声明中未提及这一资源访问与功能重点。因此描述与实际行为存在实质性不一致。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger conditions are broad enough that the skill may activate on generic mentions of 'risk assessment', 'risk response', 'risk management', or 'ISO31000' without clear user intent to invoke this workflow. Unintended invocation can cause unnecessary collection of business-sensitive information and steer users into a rigid process they did not request.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The listed trigger phrases are insufficiently scoped and can match ordinary conversation about risk or compliance, increasing the chance of overbroad activation. In this context, accidental activation is more dangerous because the skill solicits potentially sensitive operational, departmental, and timeline information from users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This file’s natural-language instructions and templates are fully presented in Chinese, which imposes a specific language on users without any visible opt-in or alternative locale guidance. The policy explicitly calls for flagging language or locale constraints when the skill forces a specific language without user choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The skill describes saving versioned assessment/report files but does not clearly warn users that business-sensitive data may be persisted in named documents. Without explicit notice and consent, users may disclose confidential operational information assuming the interaction is transient, leading to unintended retention or exposure.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

L308-L310要求“每次用户确认修改后,保存当前版本的完整文档”,这意味着技能需要执行文件写入等持久化操作;但L381又声明“仅在文档解析时调用脚本”,将脚本调用限定为解析场景。两处文档对技能是否会在保存版本时执行额外代码/脚本存在直接冲突,属于意图与实现说明不一致。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

该 markdown 文件整体仅以中文编写,且未说明这是面向特定中文用户群体或地区的限定内容,也未提供语言/locale 选择。按规则,若技能内容强制特定语言而无用户 opt-in,属于自然语言层面的语言/locale 策略风险。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The instruction requires scenario abbreviations to be derived from Chinese pinyin initials, which imposes a specific language/locale convention. The document does not indicate that this is optional, user-selected, or justified as a region-specific requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module docstring and later CLI/help text are written only in Chinese, indicating a fixed language choice for user-facing interaction. The policy requires avoiding forced language or locale unless the skill offers opt-in or clearly documents a justified regional constraint, which is not present here.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.