T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/send_email.py:13- Finding
Overbroad Loading and Inheritance of Sensitive Environment Variables
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a real Resend email-sending skill, but it has review-worthy scoping and safety issues around shared environment files, API key exposure, and live outbound emails.
Review before installing. Use a Resend key with the minimum available permissions, avoid placing unrelated secrets in the same .env file, and require explicit user confirmation of recipients and content before agents send emails, especially bulk, CC, or BCC messages.
scripts/send_email.py:13Overbroad Loading and Inheritance of Sensitive Environment Variables
scripts/send_email.py:70Resend API Key Exposed in Subprocess Command-Line Arguments
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def load_env():
"""Load environment from .env files."""
paths = [
Path.home() / '.openclaw' / 'workspace' / '.env',
Path('.env').resolve(),
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def load_env():
"""Load environment from .env files."""
paths = [
Path.home() / '.openclaw' / 'workspace' / '.env',
Path('.env').resolve(),
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def load_env():
"""Load environment from .env files."""
paths = [
Path.home() / '.openclaw' / 'workspace' / '.env',
Path('.env').resolve(),
]
for path in paths:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def load_env():
"""Load environment from .env files."""
paths = [
Path.home() / '.openclaw' / 'workspace' / '.env',
Path('.env').resolve(),
]
for path in paths:
The skill exposes shell and environment-variable capabilities but does not declare any tool scope or permission boundaries in its manifest. This increases the chance that an agent can invoke external commands and access secrets without clear review or policy enforcement, which is especially risky for a skill that sends outbound communications.
The skill description does not warn that recipient addresses, subject lines, and message bodies are transmitted to Resend, a third-party email provider. Users or agents may therefore send sensitive or regulated information externally without informed consent, creating privacy, compliance, and data-handling risks.
The agent-facing example encourages direct execution to send email but omits any warning that this performs a real outbound action to live recipients. In an autonomous or semi-autonomous setting, that can lead to unintended notifications, spam, data leakage, or reputational harm if the agent triggers the skill without explicit confirmation.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import sys
from pathlib import Path
RESEND_API_URL = "https://api.resend.com/emails"
def load_env():
This code sends email content, recipients, and related metadata to the Resend API via an external network call. While the module and function names indicate email sending, there is no explicit user-facing disclosure in the CLI flow warning that supplied data will be transmitted to a third-party service.
Using an external curl subprocess gives the skill unnecessary process-execution capability for a task that only requires an HTTPS POST. While there is no obvious shell injection here, relying on an external binary increases attack surface through PATH hijacking, environment manipulation, and operational policy bypass compared with direct in-process HTTP requests.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
'-d', json.dumps(payload)
]
result = subprocess.run(curl_cmd, capture_output=True, text=True)
if result.returncode == 0:
try:
No suspicious patterns detected.