T09 · Insecure Skill Coding Practices
- 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
Security audit
Security checks for vulnerabilities and agentic risk
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.
scripts/smartbill_cli.py:57SmartBill credentials and invoice data can be transmitted to an arbitrary endpoint
scripts/smartbill_cli.py:135Debug mode exposes customer and invoice data through process logs
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.
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())
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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
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.
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.
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.