T09 · Insecure Skill Coding Practices
- Location
scripts/poll_daemon.py:27- Finding
API Key Disclosure Through Unrestricted Polling Base URL
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches its stated THRD email-inbox purpose, but one polling script can send the THRD API key to an arbitrary user-supplied server.
Install only if you trust THRD and are comfortable giving the skill a THRD_API_KEY for email operations. Do not run poll_daemon.py with a custom --base-url unless you have reviewed and trust that endpoint; prefer the default api.thrd.email endpoint, use an isolated environment, and consider pinning dependencies before installation.
scripts/poll_daemon.py:27API Key Disclosure Through Unrestricted Polling Base URL
requirements.txt:1Unpinned and Unhashed Third-Party Dependency Installation
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
payload = {"plan": plan}
try:
response = requests.post(url, json=payload, headers=headers, timeout=30)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
while True:
try:
resp = requests.get(
f"{base_url}/v1/events",
headers=headers,
params={"cursor": cursor, "timeout": args.timeout_ms, "limit": args.limit},
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
}
print(json.dumps(summary))
ack = requests.post(
f"{base_url}/v1/events/ack",
headers=headers,
json={"cursor": str(next_cursor)},
This finding highlights that the skill description promises secure email-management features, while the referenced workflow prominently includes OpenAPI synchronization/caching and local persistence in a .cache directory that are not fully disclosed in the top-level declaration. In security-sensitive agent ecosystems, undocumented persistence and behavior drift can hide data retention, stale-trust assumptions, or unexpected network/file operations from users and policy engines.
This finding highlights that the skill description promises secure email-management features, while the referenced workflow prominently includes OpenAPI synchronization/caching and local persistence in a .cache directory that are not fully disclosed in the top-level declaration. In security-sensitive agent ecosystems, undocumented persistence and behavior drift can hide data retention, stale-trust assumptions, or unexpected network/file operations from users and policy engines.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
Many LLM runtimes do not reliably maintain background polling. Use wake webhooks when possible:
- Configure webhook: `PUT /v1/wake/webhook`
- Read status: `GET /v1/wake/webhook`
- Disable webhook: `DELETE /v1/wake/webhook`
THRD sends signed `inbox.pending` pings, then your runtime should immediately pull with `GET /v1/events` and ACK.
The skill declares executable install/runtime behaviors and clearly implies access to environment variables, filesystem state, and network resources, but it does not declare an explicit tool scope such as permissions or allowed-tools. In an agent setting, missing scope boundaries increases the chance the runtime grants broader capabilities than intended, making misuse of secrets, disk writes, or outbound requests harder to constrain and audit.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
payload = {"plan": plan}
try:
response = requests.post(url, json=payload, headers=headers, timeout=30)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
payload = {"plan": plan}
try:
response = requests.post(url, json=payload, headers=headers, timeout=30)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
SPEC_URL = "https://api.thrd.email/openapi.json"
def now_iso() -> str:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
SPEC_URL = "https://api.thrd.email/openapi.json"
def now_iso() -> str:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
SPEC_URL = "https://api.thrd.email/openapi.json"
def now_iso() -> str:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
SPEC_URL = "https://api.thrd.email/openapi.json"
def now_iso() -> str:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
SPEC_URL = "https://api.thrd.email/openapi.json"
def now_iso() -> str:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
SPEC_URL = "https://api.thrd.email/openapi.json"
def now_iso() -> str:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
SPEC_URL = "https://api.thrd.email/openapi.json"
def now_iso() -> str:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
SPEC_URL = "https://api.thrd.email/openapi.json"
def now_iso() -> str:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
SPEC_URL = "https://api.thrd.email/openapi.json"
def now_iso() -> str:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
SPEC_URL = "https://api.thrd.email/openapi.json"
def now_iso() -> str:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
SPEC_URL = "https://api.thrd.email/openapi.json"
def now_iso() -> str:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
SPEC_URL = "https://api.thrd.email/openapi.json"
def now_iso() -> str:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
SPEC_URL = "https://api.thrd.email/openapi.json"
def now_iso() -> str:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
SPEC_URL = "https://api.thrd.email/openapi.json"
def now_iso() -> str:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
SPEC_URL = "https://api.thrd.email/openapi.json"
def now_iso() -> str:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import requests
SPEC_URL = "https://api.thrd.email/openapi.json"
def now_iso() -> str:
No suspicious patterns detected.