Back to skill

Security audit

仅适用于北京市企业职工基本养老保险退休金测算。支持依据北京政策参数计算基础养老金、个人账户养老金、过渡性养老金,并对未退休用户做未来缴费策略优化。

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a legitimate Beijing pension calculator, but it should be reviewed because it persists sensitive pension records and exposes under-scoped local write behavior.

Install only if you are comfortable processing pension records locally. Use redacted copies where possible, run it in a dedicated working directory, delete generated tmp JSON/Markdown files after use, and restrict parameter updates to the bundled data/beijing_params.json file. Do not treat generated confirmation Markdown as trusted agent instructions, and prefer pinned dependency versions for reproducible installs.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/export_confirmation_form.py:13
Finding

Unescaped User-Controlled Content in Generated Markdown Confirmation Forms

Content
View full analysis
str: if v is None: return "" return str(v) ``` ```python lines.append(f"- Input file: `{data.get('source', {}).get('input_file', '')}`") lines.append(f"- Input format: `{data.get('source', {}).get('input_format', '')}`") ``` ```python for k, v in fields: c = float(conf.get(k, 0.0)) need = "YES" if k in low else "NO" lines.append(f"| `{k}` | `{fmt(v)}` | `{c:.2f}` | `{need}` | |") ``` The first two strings above are translated representations of the source labels; the interpolation behavior is identical to the audited code. ### Technical Analysis Values read from an imported JSON, CSV, XLSX, or OCR result are converted directly to strings and interpolated into a Markdown document. The implementation does not escape: - Backticks, which can terminate inline code formatting - Pipe characters, which can create additional table columns - Carriage returns and line feeds, which can inject new Markdown blocks - HTML tags supported by some Markdown renderers - Other Markdown control sequences, such as links and headings The source input path is also inserted into Markdown without escaping. Because the Skill workflow directs an agent or user to inspect the generated confirmation form, attacker-controlled input can be presented as if it were trusted workflow content. This creates an indirect prompt-injection channel when an AI agent reads the generated Markdown. It also allows visual spoofing of confirmation fields when a human opens the document. The vulnerability does not independently bypass platform-level safety controls or execute operating-system commands. ### Attack Path 1. An attacker prepares an otherwise valid supported input file. 2. A field such as `name` contains ...[truncated 1432 chars]
Remediation
View remediation
str: if value is None: return "" text = str(value).replace("\r", "\\r").replace("\n", "\\n") text = text.replace("\\", "\\\\") text = text.replace("`", "\\`").replace("|", "\\|") text = text.replace("<", "<").replace(">", ">") return text ``` The order of escaping should be verified carefully so that newly added backslashes are not escaped twice. ]]>

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Non-Reproducible Third-Party Dependency Resolution

Content
View full analysis
=2.0,<3.0 openpyxl>=3.1,<4.0 ``` The documented installation command is: ```bash python3 -m pip install -r requirements.txt ``` ### Technical Analysis The dependency file specifies broad version ranges rather than exact, reviewed versions. No lock file or package hashes are provided. Consequently, two installations performed at different times may resolve to different package releases. The package names are established projects, and the audit found no suspicious package repository or typographical dependency name. Nevertheless, future releases within the accepted ranges are automatically eligible for installation without being covered by the current review. Python packages may execute code during installation and are later imported by the ingestion workflow. A compromised, malicious, or unexpectedly incompatible future release could therefore affect the Skill even though the Skill's own source remains unchanged. ### Attack Path 1. A user follows the documented command to install dependencies. 2. The package resolver queries the configured Python package index. 3. A newer release satisfying the broad range is selected. 4. The selected release is installed without verification against a reviewed hash or lock file. 5. Package installation code may execute in the installer context. 6. The Skill later imports `pandas` and uses `openpyxl` while processing user-controlled spreadsheet files. 7. A compromised release could execute code with the privileges of the user running the installation or Skill. This exploitation path requires a malicious or compromised dependency release, package-index compromise, or unsafe index configuration. No such compromise was observed in the audited repository. ### Impact Asses ...[truncated 531 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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (27)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Unlike a pure documentation mismatch, this variant explicitly describes modifying local parameter files and persisting JSON via command-line tooling while presenting itself as a pension-calculation skill. That can cause an agent or operator to authorize write operations under false assumptions, increasing the risk of unauthorized local state changes or accidental tampering with policy parameter data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Unlike a pure documentation mismatch, this variant explicitly describes modifying local parameter files and persisting JSON via command-line tooling while presenting itself as a pension-calculation skill. That can cause an agent or operator to authorize write operations under false assumptions, increasing the risk of unauthorized local state changes or accidental tampering with policy parameter data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Unlike a pure documentation mismatch, this variant explicitly describes modifying local parameter files and persisting JSON via command-line tooling while presenting itself as a pension-calculation skill. That can cause an agent or operator to authorize write operations under false assumptions, increasing the risk of unauthorized local state changes or accidental tampering with policy parameter data.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest says the skill is for Beijing enterprise employee basic pension estimation, including calculating basic pension, individual account pension, transitional pension, and optimizing future contribution strategies for non-retirees. This file instead only computes statutory retirement date, delayed-retirement age, and minimum contribution months under a gradual delay policy; it performs none of the promised pension amount calculations or strategy optimization.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises and references shell execution, file reads, and file writes, but does not declare any explicit tool scope such as allowed-tools or permissions. That creates an over-privileged execution model where an agent may invoke local scripts or modify files beyond what users expect, increasing the risk of unintended command execution or file tampering if the surrounding platform permits those capabilities.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill instructs users to import or OCR highly sensitive social security and pension records, but it does not provide any explicit privacy warning, handling notice, or minimization guidance. In a workflow involving personal identifiers, contribution histories, and benefits data, that omission can lead users to overshare sensitive documents and increases privacy and compliance risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill specifies installation of the Chinese OCR language pack and states the script defaults to -l chi_sim+eng, indicating a fixed language/locale behavior. There is no accompanying statement offering the user a language choice or clarifying that this locale restriction is optional, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The generated markdown headings and instructions are hard-coded in Chinese, which imposes a specific language on users. The file does not offer any language/locale option or explain that the skill is intentionally limited to a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest describes a Beijing retirement pension calculator and contribution-strategy optimizer, but this file performs document ingestion from images via OCR and transforms arbitrary input files into a calculator JSON payload. OCR-based extraction and file conversion are broader data-processing capabilities than the stated calculation function, and are not mentioned in the manifest description.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The OCR path requires the Chinese language pack and invokes Tesseract with -l chi_sim+eng, which imposes a specific language/locale behavior. There is no user opt-in, configurable language selection, or documentation in this file explaining that the skill is intentionally limited to Chinese-language inputs.

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 · scripts/ingest_user_data.py (reported line 200)May include surrounding context.

python
"未找到 tesseract 可执行文件。请先安装 tesseract-ocr 和中文语言包 chi_sim 后重试。"
        )
    cmd = ["tesseract", str(path), "stdout", "-l", "chi_sim+eng", "--psm", "6"]
    proc = subprocess.run(cmd, capture_output=True, text=True, check=False)
    if proc.returncode != 0:
        raise RuntimeError(proc.stderr.strip() or "OCR失败")
    return proc.stdout

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script writes raw OCR excerpts, source file paths, review metadata, and normalized pension-related personal data into a JSON output file. In this skill context, the data includes sensitive personal information such as name, birth date, employment history, and account balances, so persisting it without minimization or explicit retention controls increases privacy and disclosure risk if the output file is exposed or reused unexpectedly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The output file contains highly sensitive personal and financial retirement data, yet the script provides no user-facing warning, consent flow, retention notice, or file-permission hardening. In a pension-calculation skill, this context makes the issue more serious because the expected inputs are real identity and benefits records, so accidental persistence can create meaningful privacy and compliance exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script collects sensitive personal and financial data, including name, birth date, contribution history, and account balance, then writes it in cleartext JSON to a predictable local path under tmp without warning the user. This creates a privacy and data exposure risk because other local users, backup systems, logs, or leftover files may retain or access the information unexpectedly.

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 · scripts/interactive_run.py (reported line 121)May include surrounding context.

python
in_path.write_text(json.dumps(payload, ensure_ascii=False, indent=2), encoding="utf-8")

    cmd = ["python3", str(ROOT / "scripts" / "calc_pension_beijing.py"), "--input", str(in_path)]
    result = subprocess.check_output(cmd, text=True)
    out_path.write_text(result, encoding="utf-8")

    print("\n已完成测算")

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest narrows the skill to Beijing enterprise employee basic pension estimation based on Beijing policy parameters. The implemented logic uses broad categories like male_60/female_55/female_50 and delayed-retirement rules, but contains no Beijing-specific pension parameters or formulas for the three pension components described in the manifest.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The generic save_json helper will write attacker-controlled JSON content to any path passed into it by the caller, and main() exposes that via the --params argument. In isolation the helper is not dangerous, but in this skill it underpins a broader arbitrary file write capability that is unrelated to pension calculation and could be abused to corrupt local files the process can access.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script accepts a user-supplied --params path and then loads and overwrites that file with no restriction that it be the intended Beijing parameter JSON. In an agent or tool-execution context, this creates an arbitrary local file modification primitive within the permissions of the process, which exceeds the stated retirement-calculation purpose and can damage other application data or configuration files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This JSON file is scoped to the Beijing region and all descriptive notes are written only in Chinese, which can constitute a locale-specific behavior without any visible user choice or opt-in. Under the stated policy, locale constraints should either be optional for users or clearly documented as a justified region-specific tool.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The JSON includes a person name value in Chinese ("示例用户"), which suggests the skill or its sample inputs may be tailored to a specific language/locale. For all file types, locale-specific natural-language choices should either be optional or clearly justified; this file provides no indication that users can choose a language or that the locale is intentionally constrained.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This JSON sample includes a natural-language value in Chinese ("已退休示例"), which reflects a specific language/locale choice in the file content. Under the stated policy, forcing a specific language without user opt-in can be a policy concern, and there is no indication here of any language choice or documented locale justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This file contains natural-language labels entirely in Chinese, which can impose a specific language on users without any visible opt-in or documented locale constraint. Under the policy rule for language or locale violations, forcing a specific language without user choice can be a finding.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This markdown file consists entirely of Chinese headings and usage instructions, and it does not indicate that the skill is region-specific by design or provide users a language/locale choice. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Unverifiable Dependency: pandas has 1 known advisory(ies) (CVE-2020-13091 (** DISPUTED ** pandas through 1.0.3 can unserialize and execute commands from an)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Unverifiable Dependency: openpyxl has 2 known advisory(ies) (CVE-2017-5992 (Improper Restriction of XML External Entity Reference in Openpyxl); CVE-2017-5992 (Openpyxl 2.4.1 resolves external entities by default, which allows remote attack)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.