Back to skill

Security audit

SmartBill Invoicing

Security checks for vulnerabilities and agentic risk

Overview

This SmartBill invoicing skill is coherent, but it needs review because a configurable API URL can redirect SmartBill credentials and invoice data to an unapproved server.

Review this before installing in a production SmartBill account. Use only the default SmartBill API host, do not set MAVERICK_SMARTBILL_API_BASE or --base-url from untrusted input, keep debug mode off around real customer data, and require a human confirmation before --allow-final invoice creation.

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

Error
Location
scripts/smartbill_cli.py:57
Finding

SmartBill credentials and invoice data can be transmitted to an arbitrary endpoint

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/smartbill_cli.py:135
Finding

Debug mode exposes customer and invoice data through process logs

Content
View full analysis
" print(json.dumps({ "smartbill_response": { "status": response.status, "headers": response_headers, "body": response_body_log, } }, ensure_ascii=False), file=sys.stderr) ``` ```python # --- error response debug log --- if self.config.debug: try: error_body_log: Any = json.loads(error_body.decode("utf-8")) except Exception: error_body_log = error_body.decode("utf-8", errors="replace") print(json.dumps({ "smartbill_response": { "status": exc.code, "headers": error_headers, "body": error_body_log, } }, ensure_ascii=False), file=sys.stderr) ``` ### Technical Analysis When debug mode is enabled using `--debug` or `MAVERICK_SMARTBILL_DEBUG`, the implementation ...[truncated 2527 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • 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
Findings (7)

Tainted flow: 'request' from os.getenv (line 156, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
95% confidence
Finding

The CLI allows the API base URL to be overridden from arguments or environment and then sends Basic-authenticated requests to that URL. If an attacker can influence MAVERICK_SMARTBILL_API_BASE or --base-url, they can redirect requests and exfiltrate the SmartBill username/token to an arbitrary server, which is especially relevant in agent or automation contexts where environment variables may be prompt-influenced or inherited.

Content

Scanner excerpt · scripts/smartbill_cli.py (reported line 158)May include surrounding context.

python
request = Request(url=url, data=payload, headers=headers, method=method)
            try:
                with urlopen(request, timeout=self.config.timeout_seconds) as response:
                    response_body = response.read()
                    response_headers = dict(response.headers.items())

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/smartbill_cli.py (reported line 434)May include surrounding context.

python
Two controls are applied in combination:

    1. Must have a .pdf suffix — prevents overwriting files that can never
       legitimately be PDFs (/etc/passwd, ~/.ssh/authorized_keys, …).
    2. Must resolve within an OpenClaw-allowed media root or the current
       working directory — prevents a prompt-injected agent from writing to
       arbitrary locations (e.g. ~/.ssh/authorized_keys.pdf) even when the

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/smartbill_cli.py (reported line 437)May include surrounding context.

python
Two controls are applied in combination:

    1. Must have a .pdf suffix — prevents overwriting files that can never
       legitimately be PDFs (/etc/passwd, ~/.ssh/authorized_keys, …).
    2. Must resolve within an OpenClaw-allowed media root or the current
       working directory — prevents a prompt-injected agent from writing to
       arbitrary locations (e.g. ~/.ssh/authorized_keys.pdf) even when the

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/smartbill_cli.py (reported line 434)May include surrounding context.

python
Two controls are applied in combination:

    1. Must have a .pdf suffix — prevents overwriting files that can never
       legitimately be PDFs (/etc/passwd, ~/.ssh/authorized_keys, …).
    2. Must resolve within an OpenClaw-allowed media root or the current
       working directory — prevents a prompt-injected agent from writing to
       arbitrary locations (e.g. ~/.ssh/authorized_keys.pdf) even when the

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill describes capabilities that access environment secrets, read/write local files, and make network requests to a billing API, but it does not declare any explicit tool scope or permissions boundary. This creates a least-privilege gap: an agent or runtime may grant broader access than intended, increasing the chance of credential exposure, unintended filesystem writes, or unauthorized invoice/API actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

When debug mode is enabled, the code logs full request bodies to stderr, which can include invoice contents, customer details, addresses, tax identifiers, and other billing data. In agent environments, stderr is often centrally collected, persisted, or exposed to users/operators, turning debugging into a data leakage channel.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The debug response logging prints full API response and error bodies to stderr, which may contain invoice data, account information, or other sensitive business records returned by SmartBill. Because these logs may be stored outside the user's control, sensitive server responses can be unintentionally disclosed.

Content

No source excerpt is available for this finding.