Back to skill

Security audit

InvoiceGuard Pro

Security checks for vulnerabilities and agentic risk

Overview

The skill is an invoice-compliance helper, but it overstates verification capabilities and can report unverified invoices as normal while handling sensitive invoice data.

Install only after confirming you will not rely on it as proof of invoice authenticity until real tax verification is implemented, and require explicit approval before sending invoice data to OCR services, tax verification endpoints, or Feishu documents/tables. Treat generated reports as internal drafts, especially when records show unchecked verification.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/compliance_report.py:284
Finding

Unverified invoices are incorrectly reported as verified and normal

Content
View full analysis
str: """生成第四节:验真结果""" abnormal_records = [ r for r in records if r.verify_status in ("void", "red", "失控", "suspicious", "abnormal") ] if not abnormal_records: return """## 四、验真结果 **异常发票数量**:0 张 **异常发票金额**:¥0.00 ✅ 全部发票状态正常。 """ ``` The Feishu report generator contains equivalent behavior: ```python abnormal_records = [r for r in records if r.verify_status in ("void", "red", "失控", "suspicious", "abnormal")] if not abnormal_records: lines.append("\n全部发票状态正常\n\n") lines.append("**异常发票数量**:0 张 ") lines.append("**异常发票金额**:¥0.00") ``` The tax verification function does not perform verification and leaves the record unchecked: ```python def verify_invoice_tax( record: InvoiceRecord, tier: TierConfig, ) -> tuple[str, str]: allowed, msg = tier.allow_verify() if not allowed: return "unchecked", msg # TODO: 调用国家税务总局增值税发票查验平台 API # 参考: references/tax-api.md # 此处占位,实际接入需要企业纳税人账号 return "unchecked", "国税查验 API 接入占位(待配置企业账号)" ``` ### Technical Analysis The reporting logic treats the absence of a known abnormal status as proof that every invoice is normal. Records with the default `verify_status` value of `unchecked` are excluded from `abnormal_records`. If all records are unchecked, the resulting report states that all invoices are normal. This is a fail-open state-modeling flaw. Verification states should distinguish at least: - Successfully verified as normal - Successfully verified as abnormal - Not verifie ...[truncated 1499 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/batch_processor.py:459
Finding

Pro-tier authorization and quota controls are fail-open and caller-controlled

Content
View full analysis
2: historical = json.loads(sys.argv[2]) if len(sys.argv) > 3: tier_data = json.loads(sys.argv[3]) tier = TierConfig( is_pro=tier_data.get("is_pro", False), monthly_processed=tier_data.get("monthly_processed", 0), ) ``` The duplicate-checking CLI applies the same pattern: ```python # C-3: tier config from CLI (optional third arg) tier = TierConfig(is_pro=True) # default to Pro for CLI usage if len(sys.argv) > 3: tier_data = json.loads(sys.argv[3]) tier = TierConfig( is_pro=tier_data.get("is_pro", False), monthly_count=tier_data.get("monthly_count", 0), ) ``` ### Technical Analysis Both command-line interfaces default callers to Pro status. When tier information is supplied, the scripts trust the caller-provided `is_pro` and usage-counter values without authentication, signature validation, or a server-side entitlement lookup. Consequently, the authorization decision is made from attacker-controlled input. A caller can either omit tier data and receive Pro status by default or explicitly submit `{"is_pro": true}`. A caller can also reset `monthly_processed` or `monthly_count` to zero to bypass free-tier quotas. The controls are additionally non-persistent. Usage is updated only in the in-memory `TierConfig` instance, so separate process invocations do not provide reliable monthly quota accounting. The current tax verification function is a placeholder, so this finding does not currently grant access to a working tax API. However, the same authorization path would expose that paid or privileged operation if the placeh ...[truncated 1364 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/compliance_report.py:258
Finding

Attacker-controlled invoice fields are inserted into Markdown and Feishu documents without escaping

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (24)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill documentation claims operational capabilities—including tax-system verification, image-based duplicate checks, scan handling, and batch processing—that are not substantiated, creating a false trust boundary around financial controls. In invoice fraud and reimbursement contexts, incomplete or simulated checks can directly enable acceptance of duplicate, forged, or noncompliant invoices.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill documentation claims operational capabilities—including tax-system verification, image-based duplicate checks, scan handling, and batch processing—that are not substantiated, creating a false trust boundary around financial controls. In invoice fraud and reimbursement contexts, incomplete or simulated checks can directly enable acceptance of duplicate, forged, or noncompliant invoices.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill documentation claims operational capabilities—including tax-system verification, image-based duplicate checks, scan handling, and batch processing—that are not substantiated, creating a false trust boundary around financial controls. In invoice fraud and reimbursement contexts, incomplete or simulated checks can directly enable acceptance of duplicate, forged, or noncompliant invoices.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill omits a clear warning that invoice contents may be sent to external OCR/parsing tools, tax verification services, and Feishu storage/collaboration systems. Because invoices contain sensitive financial and taxpayer information, lack of transparent disclosure undermines informed consent and can create privacy, contractual, and regulatory violations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list includes broad, common business terms such as 发票, 报销, and 合规, which can cause the skill to activate in unrelated conversations. Mis-triggering a finance-oriented skill increases the chance of unnecessary processing or disclosure of sensitive invoice and company information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation describes sending invoice details into Feishu cloud documents and Bitable, but does not clearly warn users that this is an external data transfer and sharing surface. Because invoices contain sensitive financial, tax, and potentially personal data, users may unknowingly expose regulated information to third-party platforms or broader collaborators.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README states that raw invoice data is not stored, but other documented behavior includes writing compliance reports to local files and exporting invoice details to Feishu documents/tables. That creates a misleading data-handling claim and can cause users to disclose sensitive tax and reimbursement data under false privacy assumptions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger terms are broad enough to activate on ordinary invoice-related conversation, which can cause unintended routing into a skill that processes highly sensitive financial documents. In context, accidental invocation increases the chance of unnecessary data exposure to external parsers, tax-verification flows, or document platforms before the user has given informed consent.

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 entirely Chinese and tightly anchors the skill to Chinese invoice and tax workflows, but it does not explicitly state that the skill is China-specific or offer language/locale selection. Under the policy, forcing a locale or language without opt-in can be a natural-language policy issue unless clearly documented and justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation says invoice originals are not stored and are discarded after processing, yet the batch workflow says uploaded files are archived. That inconsistency creates a data-handling vulnerability because users may share sensitive tax and identity data under false assumptions about retention, increasing privacy, compliance, and breach exposure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The document title and all user-facing changelog content are written in Chinese, indicating the skill's natural-language materials are localized to a single language. There is no visible opt-in, alternative language option, or justification that this skill is region- or language-specific, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The template explicitly includes enterprise name and taxpayer identification number fields, which are sensitive financial and identifying data, but it provides no warning, minimization guidance, access restriction note, or retention/handling requirements. In the context of an invoice-compliance skill that processes invoices at scale, this increases the likelihood that users will generate, share, or store reports containing regulated or confidential tax data without appropriate safeguards.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill documentation describes sending invoice fields to an external tax authority verification endpoint, but it does not clearly warn users at the point of use that invoice metadata will leave the skill boundary. Invoice data can contain sensitive financial and personal/business information, so undisclosed external transmission creates a privacy and compliance risk, especially in enterprise reimbursement workflows.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring presents the skill entirely in Chinese, and there is no indication anywhere in the file that users may choose another language or locale. Under the policy, forcing a specific language without opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module-level documentation advertises official invoice authenticity verification, but the code never performs any real tax-platform check and only returns a placeholder result. In an invoice compliance tool, this can mislead downstream users or systems into believing authenticity checks occurred, creating a dangerous false sense of assurance that may allow fraudulent or duplicate invoices to pass business controls.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The verify_invoice_tax function claims to call the national tax verification platform, but it always returns 'unchecked' with a placeholder message and performs no verification. In this skill's financial/compliance context, such a mismatch is security-relevant because operators may rely on supposed anti-fraud controls that do not actually exist.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This code assembles reports that include invoice numbers, seller names, enterprise names, and taxpayer identification numbers, and it also prepares the same data for Feishu document and bitable use. While the functions are documented, there is no explicit safety disclosure warning users that sensitive financial/business data will be included in generated outputs and may be shared to external collaboration systems.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module advertises a 'triple-check' system including image similarity, but no image-similarity logic exists anywhere in the implementation. In an invoice compliance tool, this can mislead operators into believing visually altered or reformatted duplicate invoices are being detected when they are not, creating a security-relevant detection gap rather than just a documentation issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The parser and data model are built around Chinese invoice fields and Chinese-language labels, and later logic matches only Chinese text tokens such as 发票代码, 购买方, 销售方, 专用发票, and 电子. This creates a locale-specific behavior embedded in natural-language strings without any explicit opt-in or documented regional constraint in the file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file presents all instructions and reference content exclusively in Chinese, and it does not indicate that the skill is region-specific or that users may choose another language. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

Natural-language strings, docstrings, headings, CLI help text, and generated report content are all Chinese-language only. That effectively forces a specific language/locale for users without opt-in or an explicit statement that the tool is intentionally limited to a Chinese regulatory context.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The docstring states the Feishu report output satisfies the required six-section report structure and presents itself as a complete report format, but unlike generate_compliance_report it does not include the appended raw invoice detail table. This is an intent/documentation mismatch because the comments describe a fuller output than the code actually produces.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The docstring presents create_feishu_bitable_schema(app_token) as if the provided app token is part of generating the schema for feishu_bitable_app_table.create, but the implementation never uses app_token and simply returns a constant fields list. This actively misdescribes the function's behavior and can mislead callers about what the parameter affects.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The result schema documents 'image' as a possible match_type, but the function logic never returns that value. In a fraud-detection context this inconsistency can cause downstream systems, reviewers, or UI workflows to assume an image-based duplicate path exists and is functioning, weakening trust and potentially suppressing compensating controls.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.