T09 · Insecure Skill Coding Practices
- Location
scripts/buttondown.py:117- Finding
Configurable API Base Can Exfiltrate Buttondown Credentials and Sensitive Newsletter Data
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent Buttondown newsletter helper, but its unvalidated API-base override can send the user's Buttondown token and newsletter data to an arbitrary endpoint if the runtime environment is influenced.
Review before installing. Use this only with a least-privilege Buttondown API key, avoid setting BUTTONDOWN_API_BASE unless you are testing with non-production credentials, and treat preview sending as requiring explicit user approval. The package would be safer if it removed the API-base override or enforced HTTPS and an allowlist for api.buttondown.com before attaching Authorization headers.
scripts/buttondown.py:117Configurable API Base Can Exfiltrate Buttondown Credentials and Sensitive Newsletter Data
The request destination is influenced by BUTTONDOWN_API_BASE from the environment and then used in urllib.request.urlopen(), which means whoever controls the runtime environment can redirect authenticated requests to an arbitrary host. Because the Authorization header carries the Buttondown API token, this can enable credential exfiltration or unintended transmission of draft newsletter content to an attacker-controlled endpoint.
req = urllib.request.Request(url, data=body, headers=headers, method=method)
try:
with urllib.request.urlopen(req, timeout=30) as response:
text = response.read().decode()
if not text:
return {}
The skill exposes capabilities involving environment access, file reads, and network communication but does not declare an explicit tool scope such as permissions or allowed-tools. Even though the documented behavior is newsletter management, the lack of an explicit scope weakens least-privilege controls and can allow broader-than-necessary runtime access if the hosting platform relies on declared restrictions.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
- Draft-first: when creating an email, set `status: draft` unless the user explicitly approves a different status in the current conversation.
- Do not send, schedule, publish, delete, or send draft previews without explicit user approval in the current conversation.
- Do not put API keys in chat, command history, repo files, draft bodies, logs, or screenshots.
- Read the Buttondown API key from `BUTTONDOWN_API_KEY`. Store it in your shell, launcher, runtime secret store, or OpenClaw SecretRef; never ask the user to paste the token into chat.
- If using a platform account for multiple newsletters, pass the Buttondown newsletter username through `--context` or `BUTTONDOWN_CONTEXT`.
## Configuration
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
jq -n --arg subject "$SUBJECT" --rawfile body issue.md '{subject:$subject, body:$body, status:"draft"}' \
| curl -fsS -X POST "https://api.buttondown.com/v1/emails" \
-H "Authorization: Token $BUTTONDOWN_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @-
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import urllib.request
DEFAULT_API_BASE = "https://api.buttondown.com/v1"
def die(message, code=2):
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import urllib.request
DEFAULT_API_BASE = "https://api.buttondown.com/v1"
def die(message, code=2):
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import urllib.request
DEFAULT_API_BASE = "https://api.buttondown.com/v1"
def die(message, code=2):
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import urllib.request
DEFAULT_API_BASE = "https://api.buttondown.com/v1"
def die(message, code=2):
Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.
("commenting_mode", "commenting_mode"),
("secondary_id", "secondary_id"),
]:
value = getattr(args, attr, None)
if value is not None:
payload[key] = value
if getattr(args, "body_file", None):
No suspicious patterns detected.