Back to skill

Security audit

Accouting Skill For 财金记账

Security checks for vulnerabilities and agentic risk

Overview

This accounting skill is mostly coherent, but it can create financial records automatically from inferred data and has an undocumented local JSON file input path, so it needs review before installation.

Install only if you trust the remote accounting service and can scope or revoke the API token. Require the agent to show the normalized transaction and get explicit approval before every add operation, especially for OCR, speech, files, batches, or inferred/defaulted fields. Avoid passing local file paths as JSON arguments unless you intend their contents to be sent to the accounting API.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/accounting.py:148
Finding

Undocumented Local JSON File Read Can Transmit File Contents to a Remote Service

Content
View full analysis
= 3: try: raw = sys.argv[2] # Handle single-quoted JSON from shell if raw.startswith("'") and raw.endswith("'"): raw = raw[1:-1] req = json.loads(raw) except json.JSONDecodeError as e: # Try reading from file if JSON parsing fails try: with open(sys.argv[2], 'r', encoding='utf-8') as f: req = json.load(f) except: print(f"JSON parse error: {e}", file=sys.stderr) sys.exit(1) ``` File input is not documented in the Skill interface. Consequently, a command argument that appears to be invalid JSON can cause the script to read any JSON file accessible to the process. The resulting object can subsequently be transmitted to the fixed remote service through the `add` or `query` operations: ```python def cmd_add(base, token, req): if not req.get("ledgerName"): return {"error": "missing_param", "message": "ledgerName is required"} if not req.get("amount") or req["amount"] <= 0: return {"error": "invalid_param", "message": "amount must be > 0"} if not req.get("transactionType"): return {"error": "missing_param", "message": "transactionType is required (SHOURU/ZHICHU/YINGSHOU/YINGFU)"} tt = req["transactionType"].upper() if tt in ("YINGSHOU", "YINGFU") and not req.get("dueDate"): return {"error": "missing_param", "message": f"dueDate is required when transactionType={tt}"} return unwrap(request_post(base, token, "/agent/accounting/add", req)) def cmd_query(base, token ...[truncated 2085 chars]
Remediation
View remediation

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:191
Finding

Conflicting Confirmation Rules Can Cause Unreviewed Financial Record Creation

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (10)

Tainted flow: 'req' from os.getenv (line 47, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/accounting.py (reported line 35)May include surrounding context.

python
},
    )
    try:
        with urllib.request.urlopen(req, timeout=15) as resp:
            return json.loads(resp.read().decode("utf-8"))
    except urllib.error.HTTPError as e:
        body_text = e.read().decode("utf-8", errors="replace") if e.fp else ""

Tainted flow: 'req' from os.getenv (line 47, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/accounting.py (reported line 52)May include surrounding context.

python
},
    )
    try:
        with urllib.request.urlopen(req, timeout=15) as resp:
            return json.loads(resp.read().decode("utf-8"))
    except urllib.error.HTTPError as e:
        body_text = e.read().decode("utf-8", errors="replace") if e.fp else ""

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly instructs the agent to perform bookkeeping writes directly, using nearest-match/default values, without user confirmation. This is dangerous because financial record creation is a data-affecting operation, and automatic submission can create fraudulent, inaccurate, or user-unintended accounting entries, especially when fields are inferred or defaulted.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The multimedia flow also directs the agent to create accounting entries automatically after OCR/STT/file parsing. Because preprocessing outputs are error-prone and can be manipulated by crafted content, automatic record creation can result in incorrect amounts, wrong counterparties, misclassified transactions, or maliciously induced bookkeeping entries.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill invokes a Python script that relies on an API token and remote bookkeeping service, but it does not declare explicit tool scope such as allowed tools or permissions. That creates an overbroad execution surface: the agent may access environment variables, local files, or network capabilities beyond what reviewers and policy layers expect, increasing the chance of unintended data exposure or misuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill description is written as a Chinese-only invocation and behavior description, with no indication that users may choose another language or locale. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The text bookkeeping workflow says to complete bookkeeping directly without asking the user to confirm, but the later notes require confirmation for preprocessed inputs and create overall ambiguity about when approval is mandatory. In a transactional skill, such inconsistencies are dangerous because they can lead to unauthorized or mistaken state-changing operations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill gives conflicting instructions for multimedia bookkeeping: earlier sections say to create records directly without confirmation, while the later note says extracted information must be shown to the user for confirmation first. Ambiguous safety-critical workflow rules can cause an agent to choose the less safe path and write incorrect financial records based on noisy OCR/STT/file parsing output.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This skill sends potentially sensitive financial data such as ledger names, transactions, accounts, handlers, companies, and queries to a third-party remote API without any explicit user-facing notice or confirmation in the code path. In an agent setting, that can surprise users and cause unintentional disclosure of personal or business financial information to an external service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The module description presents the assistant entirely in Chinese, which can indicate a fixed language assumption without explicit user opt-in or a documented locale constraint. The file does not state that the skill is region-specific or provide an alternative language choice.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.