Back to skill

Security audit

Fapiao Clipper

Security checks for vulnerabilities and agentic risk

Overview

This invoice-management skill has a coherent purpose, but its email and setup features create meaningful risks around mailbox credentials, automatic link downloads, and file writes.

Review this skill before installing. Use it only with a dedicated app password if enabling email, disable automatic email-link following unless you trust the sources, avoid exposing the Streamlit UI publicly without authentication, and treat the generated config and SQLite database as sensitive financial records.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (5)

T03 · Remote Payload Retrieval and Execution

Error
Location
setup_config.py:157
Finding

Unverified Remote Installation Script Piped Directly to a Shell

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
invoice_clipper/email_watcher.py:173
Finding

Email Attachment Filename Allows Writes Outside the Inbox Directory

Content
View full analysis
Path: """保存文件,自动处理重名""" ext = Path(filename).suffix.lower() if not ext: ext = ".pdf" save_path = inbox_dir / filename if save_path.exists(): stem = save_path.stem for i in range(1, 200): candidate = inbox_dir / f"{stem}_{i}{ext}" if not candidate.exists(): save_path = candidate break save_path.write_bytes(payload) return save_path ``` The filename originates from an email attachment: ```python filename = part.get_filename() if not filename: continue filename = _decode_str(filename) ext = Path(filename).suffix.lower() if ext not in (".pdf", ".ofd"): continue payload = part.get_payload(decode=True) if not payload: continue save_path = _save_payload(payload, filename, inbox_dir) ``` ### Technical Analysis MIME attachment filenames are controlled by the sender. The code appends the decoded value directly to `inbox_dir` without reducing it to a basename, rejecting absolute paths, rejecting `..` components, or verifying the resolved destination. For example, a filename such as `../../target.pdf` can resolve outside the intended inbox directory. An absolute path may also cause `pathlib` to discard the preceding inbox path. The extension check does not prevent exploitation because the attacker can target any writable file whose name ends in `.pdf` or `.ofd`. The use of `write_bytes()` also overwrites an existing destination. The collision-handling logic does not provide containment and does not use atomic exclusive creation. Symbolic links present at the selected destination can create an additional file-clobbe ...[truncated 1060 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
invoice_clipper/email_watcher.py:111
Finding

Untrusted Email Links Trigger Unrestricted Server-Side Requests

Content
View full analysis
Optional[bytes]: """从 URL 下载文件内容,自动判断是否是发票文件""" try: headers = { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36", "Accept": "application/pdf, application/octet-stream, */*", } with httpx.Client(follow_redirects=True, timeout=timeout) as client: resp = client.get(url, headers=headers) content_type = resp.headers.get("content-type", "").lower() is_invoice = ( "pdf" in content_type or "ofd" in content_type or "octet-stream" in content_type or str(resp.url.path).lower().endswith((".pdf", ".ofd")) ) if resp.status_code == 200 and is_invoice and len(resp.content) > 1024: logger.info(f"链接下载成功: {url[:60]}... ({len(resp.content):,} bytes)") return resp.content if resp.status_code == 200 and len(resp.content) > 1024: ct = resp.headers.get("content-type", "").lower() if "text/html" in ct or (not is_invoice and len(resp.content) > 5000): logger.info(f" 链接返回HTML,尝试解析发票PDF: {url[:60]}") pdf_data = _extract_pdf_from_html(resp.content, url) if pdf_data: return pdf_data ``` Untrusted links are fetched automatically: ```python body = _get_email_body(msg) links = _extract_invoice_links(body) for url in links: logger.info(f"发现发票链接: {url[:60]}") content = _download_from_url(url) if content: parsed = urllib.parse.urlparse(url) filename = Path(parsed.path).name if not filename ...[truncated 2591 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
setup_config.py:88
Finding

Email Passwords and API Keys Are Collected and Stored Insecurely

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
app.py:127
Finding

Predictable Web Upload Paths Permit Temporary File Clobbering

Content
View full analysis
` as a symbolic link, opening it with `"wb"` follows the link and truncates or overwrites the linked target with attacker-supplied upload bytes. The later `unlink()` call then removes the temporary directory entry. The code also does not isolate concurrent uploads with the same name. One user's upload can overwrite another upload before processing completes, causing data corruption or cross-session confusion. ### Attack Path 1. A local attacker predicts a filename that will be uploaded, or repeatedly prepares common names such as `invoice.pdf`. 2. The attacker creates a symbolic link at `/tmp/invoice.pdf` pointing to a file writable by the Streamlit process. 3. A user uploads a file named `invoice.pdf`. 4. The application opens the predictable path with truncating write mode. 5. The operating system follows the symbolic link and writes the uploaded bytes to the target. 6. The application processes the substituted path and subsequently unlinks the `/tmp` entry. In a concurrent-session variant, two users upload files with the same filename, and one upload overwrites the other's temporary content. ### Impact Assessment An attacker wit ...[truncated 397 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (97)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The findings indicate collection of IMAP credentials, optional remote downloading, and cloud API configuration, all of which materially exceed the declared scope of a local invoice tool. When a skill under-describes credential handling and remote service usage, users may provide sensitive access under false assumptions, increasing the likelihood of account compromise or data leakage.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The findings indicate collection of IMAP credentials, optional remote downloading, and cloud API configuration, all of which materially exceed the declared scope of a local invoice tool. When a skill under-describes credential handling and remote service usage, users may provide sensitive access under false assumptions, increasing the likelihood of account compromise or data leakage.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The findings indicate collection of IMAP credentials, optional remote downloading, and cloud API configuration, all of which materially exceed the declared scope of a local invoice tool. When a skill under-describes credential handling and remote service usage, users may provide sensitive access under false assumptions, increasing the likelihood of account compromise or data leakage.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The findings indicate collection of IMAP credentials, optional remote downloading, and cloud API configuration, all of which materially exceed the declared scope of a local invoice tool. When a skill under-describes credential handling and remote service usage, users may provide sensitive access under false assumptions, increasing the likelihood of account compromise or data leakage.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The findings indicate collection of IMAP credentials, optional remote downloading, and cloud API configuration, all of which materially exceed the declared scope of a local invoice tool. When a skill under-describes credential handling and remote service usage, users may provide sensitive access under false assumptions, increasing the likelihood of account compromise or data leakage.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The findings indicate collection of IMAP credentials, optional remote downloading, and cloud API configuration, all of which materially exceed the declared scope of a local invoice tool. When a skill under-describes credential handling and remote service usage, users may provide sensitive access under false assumptions, increasing the likelihood of account compromise or data leakage.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

Automatic link-following from email is dangerous because email content is inherently untrusted and often attacker-controlled. It can lead to retrieval of malicious files, tracking URLs, credential-harvest pages, or access to internal/local services if URLs are not tightly constrained.

Content

No source excerpt is available for this finding.

Docker Socket Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Potential security issue detected. Manual review is recommended.

Content

Scanner excerpt · docker-compose.yml (reported line 17)May include surrounding context.

yaml
# 本地发票目录映射进容器
      - ~/Documents/发票夹子:/app/data
      # 可选:Ollama socket(如果有本地 Ollama)
      # - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DASHSCOPE_API_KEY=${DASHSCOPE_API_KEY:-}
      - OLLAMA_BASE_URL=${OLLAMA_BASE_URL:-http://host.docker.internal:11434}

External Script Fetching

High
Category
Supply Chain
Confidence
98% confidence
Finding

The setup hint recommends piping a remotely fetched shell script directly into sh, a well-known unsafe installation pattern. If the remote site, network path, or DNS is compromised, users can execute arbitrary code on their system with the privileges of the shell session.

Content

Scanner excerpt · setup_config.py (reported line 159)May include surrounding context.

python
]
        hint = (
            "  还没装 Ollama?\n"
            "  1. curl -fsSL https://ollama.ai/install.sh | sh\n"
            "  2. ollama pull glm-ocr:latest\n"
            "  3. ollama pull qwen3-vl:latest\n"
            "  运行: python3 main.py scan"

Rp1

Medium
Category
MCP Rug Pull
Confidence
92% confidence
Finding

The install command uses npx clawhub@latest, which fetches and executes the newest published package version at runtime rather than a reviewed, pinned release. This creates a supply-chain risk: if the package is compromised or a breaking/malicious update is published, users may execute untrusted code during installation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The claim '纯本地运行,数据不上云' conflicts with other documented capabilities such as email scanning and tax authority verification, both of which imply network access and data transmission. Misrepresenting network behavior can cause users to expose sensitive invoice and financial data under false privacy assumptions, which is a security-relevant documentation issue.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
91% confidence
Finding

The README instructs users to run npx clawhub@latest install fapiao-clipper, which pulls and executes remote package code without pinning to a specific trusted version. If the upstream package, dependency chain, or publishing account is compromised, users may execute attacker-controlled code during installation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README explicitly describes exposing the local Streamlit UI to the public internet via frp, but provides no warning about authentication, transport security, or the sensitivity of invoice data. If users follow these instructions as-is, unauthorized parties may access financial records, uploaded documents, and management functions exposed by the web app.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README makes strong privacy claims such as 'all processing is local' and 'zero data upload', but elsewhere states that the tool connects to tax-verification services and fetches invoice links from email content. That mismatch can mislead users into exposing sensitive invoice metadata or documents to third parties under a false assumption of strict locality.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
91% confidence
Finding

This repeats the same unsafe installation pattern by recommending npx clawhub@latest install fapiao-clipper. Using @latest for an executable installer means future installs are not reproducible and may silently run newly published code, including malicious updates if the package supply chain is compromised.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises executable commands and clearly implies file, shell, database, and likely network operations, yet the manifest declares no explicit tool scope or permission boundaries. In an agent environment, this can cause the skill to run with broader capabilities than users expect, increasing the chance of unintended file access, network use, or command execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill explicitly stores invoice data in a local SQLite database, but the documentation does not provide a meaningful warning about the sensitivity of financial records. Because invoices often contain names, tax IDs, addresses, account details, and transaction data, insufficient disclosure can lead users to expose regulated or confidential information without understanding retention and access risks.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The invocation examples include broad phrases like scanning invoices or organizing email that could match ordinary user requests without clear confirmation. In agent platforms, overly broad triggers can cause the skill to activate unexpectedly and perform sensitive actions such as file scanning, database updates, or email-related processing when the user did not intend to invoke this specific tool.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains natural-language UI text and labels entirely in Chinese, beginning with the module docstring and continuing throughout the interface. The policy specifically calls for flagging language or locale constraints when a skill forces a specific language without user opt-in, and no alternative language selection or justification is present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This manifest/config file contains natural-language instructions and section headers entirely in Chinese, which effectively forces a specific language for users configuring the skill. The file does not indicate that the skill is China/Chinese-specific or provide any opt-in or alternative locale, so it conflicts with the policy against unannounced language constraints.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest emphasizes a 本地大模型驱动 workflow, but this config explicitly supports the siliconflow provider with a remote HTTPS API endpoint and API key. That materially expands the skill beyond purely local processing, especially for invoice data that may contain sensitive financial information.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Adding email inbox monitoring and especially automated link-following expands the tool from local invoice processing into network-driven ingestion of untrusted content. That increases attack surface for phishing, malicious downloads, SSRF-like behavior, or unintended collection of non-invoice sensitive data from email.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Natural-language policy checks apply to all file types, including YAML comments. The file presents operational instructions exclusively in Chinese and does not offer an alternative language or indicate that the skill is intentionally limited to a Chinese-speaking audience, which is a language-policy concern under the stated rules.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file documents uploading invoice PDFs/images for automatic recognition and exporting reimbursement bundles, both of which involve sensitive financial and business data. The description presents these actions as direct UI flows but does not include any warning about privacy, data handling, file contents, or the impact of exporting/downloading business records.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module advertised as a local invoice/reimbursement tool performs outbound HTTP requests to fetch blacklist data from external sites. This creates an undeclared network dependency, can leak usage metadata, and exposes the workflow to supply-chain and availability risks if remote content is tampered with, blocked, or unexpectedly changed.

Content

No source excerpt is available for this finding.