Back to skill

Security audit

receipt-expense-workbench

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent and local, but it should be reviewed because its CSV output can carry unsafe spreadsheet formulas from receipt data.

Before installing, review the CSV formula-injection risk: do not open generated ledgers from untrusted receipt or invoice text in spreadsheet software with formula execution enabled unless values are sanitized. Use explicit input and output paths, redact unnecessary personal or financial details, and invoke the skill only when you clearly want receipt or reimbursement materials processed.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/expense_ledger.py:27
Finding
Spreadsheet Formula Injection in Generated Expense Ledger<![CDATA[ ## Vulnerability Details **File Location**: `scripts/expense_ledger.py`, lines 27–41 **Vulnerability Type**: CSV/spreadsheet formula injection **Risk Level**: Medium ```python w = csv.DictWriter(f, fieldnames=fields) w.writeheader() for item in items: desc = item.get("description","") amt = str(item.get("amount","")) flag = "check" if not amt else "" w.writerow({ "vendor": item.get("vendor",""), "date": item.get("date",""), "amount": amt, "currency": item.get("currency",""), "description": desc, "category": item.get("category") or categorize(desc + " " + item.get("vendor","")), "flag": flag }) ``` ### Technical Analysis The script copies receipt-derived values into CSV cells without neutralizing spreadsheet formula prefixes. Values in fields such as `vendor`, `date`, `amount`, `currency`, `description`, and user-supplied `category` can begin with characters interpreted as formulas by spreadsheet applications, including `=`, `+`, `-`, and `@`. CSV escaping and quoting do not reliably prevent formula evaluation. Consequently, an attacker-controlled receipt, OCR result, or JSON input could place a formula such as the following into the generated ledger: ```text =HYPERLINK("https://attacker.invalid/collect","Open receipt") ``` When the CSV is opened in a spreadsheet application that evaluates formulas, the cell can present a deceptive link or invoke other application-supported formula behavior. The exact result depends on the spreadsheet product, version, security configuration, and whether the user interacts with prompts or links. ### Attack Path 1. An attacker supplies a receipt, invoice, reimbursement record, or OCR-derived value containing a spreadsheet formula prefix. 2. That value is included in the JSON input as a field such as `vendor`, `descrip ...[truncated 1384 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Treat every value written to the CSV as untrusted, including values that appear numeric or categorical. 2. Before writing a cell, detect dangerous formula prefixes after any leading spaces, tabs, carriage returns, or line feeds. 3. Neutralize cells beginning with `=`, `+`, `-`, or `@`. One common mitigation is to prefix the value with a single quote, provided the behavior is verified in all supported spreadsheet applications. 4. Prefer an output format that supports an explicit text cell type, such as XLSX generated by a trusted library, and configure every untrusted field as text. 5. Validate `amount`, `date`, `currency`, and `category` against strict schemas rather than accepting arbitrary strings. 6. Add regression tests for direct and whitespace-prefixed payloads, including: ```text =1+1 +SUM(1,1) -1+2 @SUM(1,1) =HYPERLINK("https://attacker.invalid","Open") ``` 7. Document that generated CSV files contain untrusted receipt data and should not be opened with automatic formula evaluation enabled until sanitization is implemented. ]]>
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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 (7)

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
This markdown file uses Chinese for all substantive instructions and evaluation content, but does not indicate that the skill is region-specific or provide any opt-in for language/locale. Under the policy, forcing a specific language without user choice is a natural-language policy violation.

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill declares a local script and generated CSV output, which implies file read/write behavior, but it does not declare any explicit tool scope such as permissions or allowed-tools. That creates an authorization ambiguity where an agent runtime may permit broader filesystem access than users expect, increasing the risk of unintended reading or writing of sensitive financial data.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The skill is designed to process receipts, invoices, and reimbursement materials, which commonly contain sensitive financial and personal information, yet it provides no warning or handling notice. Users may submit confidential data without understanding retention, exposure, or minimization expectations, which raises privacy and compliance risk.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger phrase "expense ledger" is broad enough to match ordinary finance-related requests that may not intend to invoke this skill. Overbroad activation can cause the agent to process sensitive receipts or financial text unexpectedly, increasing the chance of unnecessary data exposure or unintended file generation.

Natural-Language Policy Violations

Medium
Confidence
87% confidence
Finding
This markdown file is written entirely in Chinese and uses Chinese instructions as the expected operating language, but it does not mention that the skill is locale-specific or provide any user opt-in for language preference. Under the policy, forcing a specific language without opt-in is a natural-language policy violation.

Natural-Language Policy Violations

Low
Confidence
87% confidence
Finding
The file presents core instructions, triggers, and warnings in both Chinese and English, but does not state a supported language policy or let the user choose their preferred language. This can create a locale-policy issue if the skill effectively assumes bilingual comprehension without opt-in.

Natural-Language Policy Violations

Low
Confidence
72% confidence
Finding
The trigger list mixes Chinese and English phrases, but the skill does not explain whether it is intended for multilingual use or how language selection is handled. This can be a locale-policy concern when a skill implicitly assumes or privileges specific languages without documenting user choice or context.

Static analysis

No suspicious patterns detected.