Back to skill

Security audit

ClawHub Dev Invoice

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward invoice generator with some quality and local-file safety issues, but no evidence of hidden, persistent, destructive, or unrelated behavior.

Install only if you are comfortable reviewing or fixing the script before use. Treat client invoice data as sensitive business/contact information, do not use untrusted JSON input, and escape invoice fields before generating HTML or PDFs.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_invoice.py:46
Finding

Unescaped JSON Data Allows HTML and Script Injection

Content
View full analysis
Invoice {data['invoice_num']} ``` ```python

Invoice #{data['invoice_num']}

Date: {data['date']} | Due: {data['due_date']}

Bill To:

{data['client']['name']}
{data['client']['address']}
{data['client']['email']}

``` ### Technical Analysis Values loaded from the supplied JSON file are interpolated directly into an HTML document without contextual output encoding. The affected fields include the invoice number, invoice and due dates, and client identity and contact fields. Because HTML metacharacters are not escaped, a value can terminate its intended text context and introduce arbitrary HTML elements. Depending on how the generated document is opened or converted, the injected markup may include scripts, event handlers, forms, misleading invoice content, or references to attacker-controlled remote resources. For example, a client name containing an image element with an error event handler would be embedded directly into the invoice: ```json { "client": { "name": "", "address": "Example Address", "email": "billing@example.com" } } ``` The source currently has a syntax error at line 99, so the vulnerable generation path cannot execute as provided. The vulnerability becomes reachable if that syntax error is corrected without also implementing output encoding. ### Attack Path 1. An attacker supplies or modifies an invoice JSON file. 2. The attacker places an HTML or JavaScript payload in an affected field such as `client.name`, `client.address`, `client.email`, or `invoice_num`. 3. The user invokes the invoice generator after the line 99 syntax error has been repaired. 4. The script inserts the payload into ...[truncated 925 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/generate_invoice.py:96
Finding

Predictable Output Path Can Overwrite Files Through a Pre-Planted Symbolic Link

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • 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 (4)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The markdown instructs the user to gather client name, company, address, and email, then process that data into invoices, but it provides no warning about handling personal/business contact information or verifying consent and secure storage. For markdown files, SQP-2 applies when user-impacting privacy behavior is described without warning.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The docstring states the script generates an HTML invoice from JSON input, implying the invoice contents will reflect that input. However, L78 uses doubled braces inside an f-string, so the HTML table contains literal text like {item['desc']} and {qty} rather than the provided invoice data, contradicting the documented intent.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The module docstring says the script outputs an invoice-specific HTML file such as invoice_XXXX.html, but L92 constructs the filename as the literal string "invoice_{data['invoice_num']}.html" because the f-string escapes are incorrect. This is an active contradiction between the documented behavior and the implemented behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

This code creates a new HTML file on disk, which is a file-write operation covered by the missing user warnings rule for code files. While the module docstring mentions the output file generally and the script prints after writing, there is no confirmation or explicit pre-write disclosure at the point of execution about creating or overwriting a local file.

Content

No source excerpt is available for this finding.