Back to skill

Security audit

Invoice Gen

Security checks for vulnerabilities and agentic risk

Overview

This skill locally generates PDF invoices and its higher-risk parts are disclosed setup steps rather than hidden behavior.

Install this only if you want a local invoice PDF generator. Use a virtual environment and pin ReportLab to a reviewed version; only run the optional sudo font-install commands if you understand they modify system packages. Do not rely on the advertised customizable templates without checking or extending the script.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:57
Finding
Unpinned Third-Party Dependency Installation## Vulnerability Details **File Location**: `SKILL.md`, line 57 **Vulnerability Type**: Unpinned Python package installation **Risk Level**: Medium ### Vulnerable Code ```bash pip3 install reportlab ``` ### Technical Analysis The installation instructions retrieve and install the version of `reportlab` selected by the active Python package index at installation time. The project does not provide a pinned version, cryptographic hashes, a lockfile, an explicitly trusted package index, or environment-isolation guidance. Consequently, the dependency installed by a user or agent can differ from the version considered during this audit. If the package distribution, dependency chain, package index, or local index configuration is compromised, package-controlled code could run during installation or when `scripts/gen_invoice.py` imports ReportLab. The audited invoice script itself contains no remote payload retrieval or malicious dependency manipulation. The risk arises from the unsafe, non-reproducible dependency installation procedure. ### Attack Path 1. An attacker compromises a relevant package release or dependency, or influences the package index used by the target environment. 2. A user or AI agent follows the documented command: ```bash pip3 install reportlab ``` 3. `pip` resolves and downloads an unverified package version from the configured index. 4. Malicious package code executes during installation or when the invoice script imports the installed package. 5. The malicious code operates with the privileges of the user or agent that performed the installation or invoked the script. ### Impact Assessment Successful exploitation could permit arbitrary code execution with the privileges of the installing or invoking account. Depending on that account's permissions, the attacker could access user-readable files, modify user-writable data, steal credentials available to the process, or execute additional local or network actions. The issue doe ...[truncated 279 chars]
Remediation
## Remediation Suggestions 1. Pin ReportLab to a reviewed, exact version rather than installing the latest available release: ```text reportlab==REVIEWED_VERSION ``` 2. Generate and commit a hash-locked requirements file, then require hash validation: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 3. Include hashes for every transitive dependency and regenerate them only through a controlled dependency-update process. 4. Document installation inside a dedicated virtual environment so the package does not alter the global Python environment: ```bash python3 -m venv .venv . .venv/bin/activate python3 -m pip install --require-hashes -r requirements.txt ``` 5. Explicitly use an approved HTTPS package index and prevent untrusted extra indexes or mirrors from participating in resolution. 6. Regularly review pinned dependencies for known vulnerabilities and update the lockfile through a tested, auditable process. 7. Advise users not to run package installation commands with administrative privileges unless strictly required.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (5)

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding
The code substantially matches the main declared purpose: it generates PDF invoices locally from command-line text inputs, supports multiple currencies, tax calculation, and CJK text via system font detection, and does not call external services. However, the description claims 'customizable templates,' but the supplied code contains only a single hardcoded invoice layout and exposes no template selection or customization mechanism. This is a material description-to-behavior mismatch, though limited in scope rather than indicating unrelated or malicious behavior.

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Vague Triggers

Medium
Confidence
89% confidence
Finding
The skill says it generates invoices from "natural language" and that "the agent will use this skill" when given a general invoice request, but it does not define clear trigger boundaries, exclusions, or specific invocation phrases. This ambiguity can cause unintended activation for ordinary discussion of invoices or billing rather than explicit requests to generate a PDF invoice.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
For CJK support, install CJK fonts:
```bash
sudo yum install -y google-noto-sans-cjk-ttc-fonts  # RHEL/CentOS
sudo apt install -y fonts-noto-cjk                    # Ubuntu/Debian
```
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
For CJK support, install CJK fonts:
```bash
sudo yum install -y google-noto-sans-cjk-ttc-fonts  # RHEL/CentOS
sudo apt install -y fonts-noto-cjk                    # Ubuntu/Debian
```
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Static analysis

No suspicious patterns detected.