T09 · Insecure Skill Coding Practices
- Location
scripts/generate_report.py:181- Finding
Spreadsheet Formula Injection in XLSX and CSV Exports
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has a coherent tax-assistant purpose, but it needs review because it stores sensitive financial records and exports spreadsheets/CSV with concrete safety gaps.
Install only if you are comfortable keeping sensitive tax and business records in local plaintext files under ~/.openclaw/data/kiwi-receipts/. Review file permissions, keep backups, validate all tax outputs with an accountant before filing, and be cautious opening generated XLSX/CSV files until spreadsheet text sanitization is fixed.
scripts/generate_report.py:181Spreadsheet Formula Injection in XLSX and CSV Exports
SKILL.md:168Sensitive Tax and Financial Records Stored Without Explicit Permission Controls
README.md:22Unpinned Third-Party Package Installation Creates Supply-Chain Exposure
The trigger list includes very broad everyday terms like "tax," "income," "receipt," and "invoice," making accidental invocation likely in unrelated conversations. In this skill, accidental activation is more dangerous because it handles and stores highly sensitive financial and tax records, so a false trigger could cause unintended collection, persistence, or export of private data.
The plan directs modification of SKILL.md, which is the skill's own instruction and behavior definition. Self-modification is dangerous because it allows an implementation workflow to alter future agent behavior, potentially expanding permissions, changing safeguards, or embedding unsafe instructions that persist after the current task.
**Goal:** Extend kiwi-receipts from GST-only to cover sales/income tracking, IR3 annual income tax, provisional tax, asset depreciation, and Xero CSV export — turning it into a near-complete personal tax assistant for NZ sole trader builders.
**Architecture:** Add 3 new JSON data files (income.json, assets.json, tax-history.json) alongside existing receipts.json. Extend config.json with new fields. Add new reference docs for income tax, depreciation, and provisional tax. Extend generate_report.py with new sheet generators. Update SKILL.md with new commands and compliance rules.
**Tech Stack:** Python 3 (openpyxl for XLSX, csv module for Xero export), JSON flat-file storage, OpenClaw SKILL.md format.
This task specifically instructs extending SKILL.md compliance rules, again modifying the governing behavior document rather than just application logic. In an adversarial or mistaken plan, such changes could silently weaken restrictions, alter disclosures, or normalize unsafe actions under the appearance of documentation work.
---
## Task 12: Update SKILL.md — Compliance Rules for Income Tax
**Files:**
- Modify: `SKILL.md` — extend Compliance Rules section
The skill performs persistent local file writes and invokes external scripts, but it does not declare any explicit tool scope or allowed-tools restrictions. That increases the blast radius if the skill is invoked unexpectedly or interpreted by a permissive agent runtime, because sensitive tax data could be written, modified, or exported without a narrowly defined permission boundary.
The skill stores business name, GST number, receipts, income, assets, and tax history on local disk, but it does not clearly warn users about that persistence in the user-facing description or setup flow. This is sensitive financial data, and absent disclosure undermines informed consent and may lead users to expose regulated or confidential business records without realizing they are retained locally.
The invocation condition "user asks about GST, income tax, or tax returns" is ambiguous and broad enough to match general informational tax questions that do not require this storage-capable skill. Because the skill can create files, append records, and generate exports, over-broad activation increases the chance of users being routed into stateful operations they did not intend.
The skill intentionally persists receipts and tax records across sessions in a fixed directory under the user's home folder. In context this is core functionality, but it still introduces real security and privacy risk because long-lived sensitive financial data accumulates on disk, potentially without encryption, retention controls, or easy user awareness.
After confirmation, append to ~/.openclaw/data/kiwi-receipts/receipts.json:
mkdir -p ~/.openclaw/data/kiwi-receipts
Read existing receipts.json (or start with []), append the new receipt with a generated UUID as id, and write back. Each receipt object:
Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.
6. **Depreciation** -- Asset depreciation schedule (if assets.json has data)
7. **IR3 Annual Tax** -- Annual income tax summary (when period=all or period=annual)
**GST101A auto-fill logic:**
If income.json has data for the period, BOTH sides are auto-filled:
- Box 5: Total sales and income (from income.json) -- AUTO-FILLED
The skill exposes a destructive "delete last" command without a clear warning in the interface text that it permanently removes receipt records. Since the records are tax-relevant and intended for compliance use, accidental deletion could cause loss of audit evidence, incomplete returns, or inability to substantiate claims.
Multiple command definitions pair English commands with Chinese alternatives such as "收入", "资产", "预缴税", and "导出xero", but the plan does not explain language selection, opt-in, or locale behavior. Per policy, locale-specific behavior should either be optional or clearly documented as justified; here the mixed-language command design appears imposed without user choice.
The Xero export workflow handles detailed financial transaction data and directs sending a CSV to the user for import into a third-party platform, but omits any warning or consent checkpoint about external disclosure. In a tax assistant context, this can lead to inadvertent exposure of sensitive client, invoice, and expense information to third-party systems or wrong destinations.
The plan explicitly instructs the implementing agent to push code to GitHub and publish to ClawHub, which grants deployment/distribution capability beyond the tax-processing purpose of the skill. Even if intended as normal release workflow, adding publish actions increases the blast radius of any mistaken or malicious changes by moving them from local edits into external systems.
The natural-language rule says records must be kept in English, which imposes a language constraint in the skill instructions. Because the file does not frame this as a documented compliance limitation of output behavior or offer user choice where possible, it may violate language/locale policy expectations.
The instruction to use a separate execution superpower/sub-skill introduces unnecessary agent orchestration capability unrelated to tax calculations or receipt processing. Chaining to a more powerful executor can bypass intended scope limits and make downstream actions harder to audit or constrain.
The guide states that the skill auto-fills GST return boxes from receipts without an explicit warning that the user must review and validate the figures before filing. In a tax-preparation context, this can cause users to over-trust OCR/classification output and submit incorrect returns, leading to compliance errors, penalties, or misstated GST claims.
This line states that records must be kept in English, which is a language constraint presented in natural language. Because SQP-3 covers language or locale policy violations, this should be clarified as an external statutory requirement to avoid appearing as an unjustified skill-level language restriction.
No suspicious patterns detected.