Back to skill

Security audit

warehouse

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to do what it says: generate local warehouse report images and files, with a CSV safety caveat for untrusted data.

Install only if you are comfortable running local Python scripts that read the selected warehouse database and write report files to the chosen output directory. Avoid opening generated CSV files in spreadsheet software when the database may contain untrusted product data, or sanitize the CSV first.

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/run_warehouse_reports.py:97
Finding
CSV Formula Injection in Missing-Products Report## Vulnerability Details **File Location**: `scripts/run_warehouse_reports.py`, lines 97–98 **Vulnerability Type**: CSV formula injection and improper CSV encoding **Risk Level**: Medium ### Vulnerable Code ```python for r in rows: f.write(",".join(str(x) for x in r) + "\n") ``` ### Technical Analysis The report generator writes database-controlled `sku`, `name`, `warehouse`, and `reorder_level` values directly into `missing_products.csv`. It neither neutralizes spreadsheet formula prefixes nor uses a standards-compliant CSV encoder. If a text field begins with `=`, `+`, `-`, or `@`, spreadsheet software may interpret it as a formula when a user opens the generated report. Depending on the spreadsheet application and its security configuration, a formula could display deceptive links, initiate external requests, disclose information, or invoke other application-specific functionality. The direct string concatenation also fails to escape commas, double quotes, carriage returns, and newlines. Crafted product values can therefore alter the report structure, inject additional cells or records, and misrepresent warehouse data. Exploitation requires an attacker to control or influence relevant values in the input SQLite database and for a user to open the resulting CSV in spreadsheet software. The Python process itself does not evaluate the injected formula. ### Attack Path 1. An attacker obtains the ability to insert or modify a zero-stock product in the input SQLite database. 2. The attacker sets a selected text field, such as `name`, to a formula-like value—for example, `=HYPERLINK("https://attacker.example","Open report")`. 3. A user invokes `run_warehouse_reports.py` against the affected database. 4. `missing_products_csv()` selects the malicious record and writes its fields verbatim to `missing_products.csv`. 5. The user opens the generated file in spreadsheet software. 6. The spreadsheet interprets the attacker-controlled cell as a formula. The ...[truncated 729 chars]
Remediation
## Remediation Suggestions 1. Use Python’s `csv` module instead of constructing CSV records through string concatenation: ```python import csv def neutralize_spreadsheet_formula(value): text = "" if value is None else str(value) if text.lstrip().startswith(("=", "+", "-", "@")): return "'" + text return text with open(out, "w", encoding="utf-8", newline="") as f: writer = csv.writer(f) writer.writerow(["sku", "name", "warehouse", "reorder_level"]) for row in rows: writer.writerow([neutralize_spreadsheet_formula(value) for value in row]) ``` 2. Define an explicit policy for fields expected to be numeric. Validate and serialize them as numeric values rather than accepting arbitrary text. 3. Neutralize formula markers after accounting for leading spaces, tabs, carriage returns, and other characters that spreadsheet applications may ignore before formula evaluation. 4. Add tests covering values containing formula prefixes, commas, double quotes, carriage returns, and embedded newlines. 5. Treat the SQLite database as untrusted input when it can be supplied or modified by external users. 6. Where formula support is unnecessary, consider generating a non-formula-capable format or importing all generated columns explicitly as text.
Vulnerability Patterns
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (1)

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill instructs the agent to run local Python scripts that generate PNG, CSV, and TXT outputs, which implies file-write capability, but the manifest declares no explicit tool scope such as permissions or allowed-tools. That mismatch weakens least-privilege controls and can let an agent invoke file-writing behavior without a clear, reviewable boundary, increasing the chance of unauthorized or unexpected writes.

Static analysis

No suspicious patterns detected.