Back to skill

Security audit

fin-reg-calc

Security checks for vulnerabilities and agentic risk

Overview

The skill is an offline finance compliance calculator, but its install path is unpinned/global and its calculator can mark invalid financial inputs as compliant.

Install only if you understand it is an auxiliary local checker, not a legal or regulatory authority. Pin the installer and repository commit before use, avoid global installation where possible, and do not wire its exit code into automated approvals until numeric input validation is fixed and reviewed by qualified compliance staff.

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/fin_reg_calc.py:11
Finding
Invalid numeric inputs can produce false compliance approvals<![CDATA[ ## Vulnerability Details **File Location**: `scripts/fin_reg_calc.py`, lines 11–39 **Vulnerability Type**: T09: Insecure Skill Coding Practices **Risk Level**: Medium ### Vulnerable Code ```python def suitability(client_risk, product_risk): diff = product_risk - client_risk if diff <= 0: return "允许", True if diff == 1: return "限制(加签/告知)", True return "禁止(适当性不匹配)", False def threshold(amount): over = amount > LARGE_TX_THRESHOLD return ("超大额须报备" if over else "未超阈"), (not over) def main(): ap = argparse.ArgumentParser(description=NAME + " · 金融AI合规计算") ap.add_argument("--suitability", nargs=2, type=int, metavar=("CLIENT_RISK", "PRODUCT_RISK"), help="适当性: 客户风险等级 产品风险等级(1-5)") ap.add_argument("--threshold", type=float, help="大额上报阈值校验: 交易金额(元)") ap.add_argument("--json", action="store_true") a = ap.parse_args() if not a.suitability and a.threshold is None: print("用法: --suitability 客户风险 产品风险 | --threshold 金额", file=sys.stderr); sys.exit(2) out = {} ok = True if a.suitability: r, c = suitability(a.suitability[0], a.suitability[1]) out["suitability"] = {"client": a.suitability[0], "product": a.suitability[1], "result": r, "compliant": c} ok = ok and c if a.threshold is not None: r, c = threshold(a.threshold) out["threshold"] = {"amount": a.threshold, "result": r, "compliant": c} ok = ok and c ``` ### Technical Analysis The CLI documents client and product risk values as integers in the range 1 through 5, but `argparse` only verifies that they are integers. It does not enforce the documented range. Consequently, arbitrary negative or excessively large risk values participate directly in the subtraction used to determine suitability. The transaction amount is parsed as a Python `float` without checking that it is finite and non-negative. Python accepts special values such as `nan`. A comparison of `nan > 50000` evaluates to f ...[truncated 1710 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Enforce both client and product risk values as integers from 1 through 5. Invalid values should produce an explanatory error and exit code 2. 2. Parse monetary values with `decimal.Decimal` rather than binary floating-point. 3. Reject non-finite values, negative amounts, empty values, and values outside the supported business domain before performing compliance comparisons. 4. Define whether the threshold itself is inclusive. The current expression uses `amount > 50000`; confirm whether an amount exactly equal to 50,000 requires reporting and encode that rule explicitly. 5. Ensure invalid inputs never produce `compliant: true` or exit code 0. 6. Configure JSON serialization to reject non-standard values such as `NaN`, for example by using `allow_nan=False`. 7. Add regression tests for `NaN`, positive and negative infinity, negative amounts, zero, exact threshold values, and risk levels below 1 or above 5. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:74
Finding
Installation instructions execute an unpinned third-party package and mutable repository content<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 74 **Vulnerability Type**: T08: Insecure Dependencies **Risk Level**: Medium ### Vulnerable Code ```bash npx skills add zhaoxinghua09-cell/agent-skills -g ``` ### Technical Analysis The installation command invokes the `skills` package through `npx` without specifying a reviewed package version or integrity value. Depending on local cache state and package-manager behavior, `npx` may retrieve and execute the currently published package from the configured registry. The command also identifies the Skill repository without pinning it to an immutable commit hash or verified release artifact. Both the installer and installed repository content can therefore change after this package has been audited. The `-g` option requests global installation, increasing the scope of any malicious or unexpectedly changed package content. This is a supply-chain exposure rather than evidence that the currently reviewed Python script is malicious. ### Attack Path 1. A user follows the documented installation command. 2. `npx` resolves an unpinned version of the `skills` package from the configured package source or cache. 3. If the package, publisher account, registry resolution, or package source has been compromised, altered package lifecycle or installer code executes with the invoking user's privileges. 4. The installer retrieves Skill content from a mutable repository reference rather than a verified commit. 5. Changed or malicious content may be installed globally and subsequently loaded or executed by supported agents. ### Impact Assessment Successful exploitation could execute code with the privileges of the user running `npx`. The reachable scope may include that user's files, credentials available to the process, agent configuration, and package installation locations. Global installation can expose the altered Skill to multiple projects or agent sessions associated with the user. The command ...[truncated 185 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin the `skills` CLI to a reviewed, exact version instead of relying on the latest registry release. 2. Pin repository installation to an immutable commit hash or a signed release tag. 3. Publish and verify cryptographic checksums or signatures for distributed Skill artifacts. 4. Avoid global installation by default. Prefer a project-local installation with the minimum permissions required. 5. Document the expected package source and advise users to verify registry and repository ownership before installation. 6. Use a lockfile or equivalent integrity metadata where the installation mechanism supports it. 7. Review updated installer and repository content whenever the pinned versions or commit hashes change. ]]>
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The skill documentation is written entirely in Chinese, including the title, description, and usage context, with no indication that users may choose another language. Under the language/locale policy, forcing a specific language without user opt-in is a natural-language policy concern unless the locale restriction is explicitly documented and justified.

Natural-Language Policy Violations

Medium
Confidence
85% confidence
Finding
The display name, title, and nearly all user-facing instructions are Chinese-only, while the file does not state that the skill is region-specific or require user opt-in to that language. This can violate language/locale policy expectations when skills are used in broader multilingual environments.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The usage guidance says to proactively install the skill for broad financial or regulated-AI work without narrowly constraining when it should be invoked. Overly broad activation guidance can cause an agent to apply the skill in inappropriate contexts, producing compliance conclusions outside its intended scope and increasing the chance of unsafe automation in high-stakes financial workflows.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding
The skill instructs users to run `npx skills add ...` without pinning a specific package version. This allows execution of whatever package version is current at install time, creating a supply-chain risk if the package changes unexpectedly or is compromised. In an agent-skill installation context, this is more dangerous because users are encouraged to execute the command directly from documentation with implicit trust.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The script’s docstring, CLI help text, usage output, and result messages are all written exclusively in Chinese, which imposes a specific language on users. The file does not offer any language/locale selection or explain that it is intentionally restricted to a Chinese-speaking or region-specific audience.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
The category value uses Chinese-language text ("AI 治理") in manifest metadata, which may impose a language-specific experience without offering any language choice or documenting a locale-specific justification. Under the language/locale policy rule, natural-language metadata that fixes a specific language can be a policy concern when no opt-in is provided.

Static analysis

No suspicious patterns detected.