T09 · Insecure Skill Coding Practices
- Location
test_send_email_direct.py:13- Finding
Hard-Coded SMTP Credentials for the Bob Mailbox
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a disclosed email API skill, but it needs review because it ships live-looking SMTP credentials, weak secret storage defaults, and no enforced anti-abuse limits for account creation or sending.
Treat this as a review-required email service, not a drop-in safe skill. Before installing or deploying it, remove and rotate the embedded SMTP credentials, replace default database credentials, avoid exposing PostgreSQL publicly, add real signup and sending quotas, protect API keys and mailbox passwords with hashing/encryption, and upgrade vulnerable dependencies. Do not expose it to the public internet in its current form.
test_send_email_direct.py:13Hard-Coded SMTP Credentials for the Bob Mailbox
test_testbot_smtp.py:13Hard-Coded SMTP Credentials for the Test-Bot Mailbox
app/models.py:15Plaintext Storage of API Keys and Mailbox Passwords
docker-compose.yml:7PostgreSQL Published with Predictable Default Credentials
app/routes/agents.py:31Unauthenticated Mailbox Provisioning and Unenforced Sending Limits
app/routes/health.py:17Unauthenticated Health Endpoint Discloses Raw Database Errors
python-jose==3.3.0 carries critical advisories including algorithm confusion, which is especially dangerous in a dependency explicitly used for authentication and token handling. If the skill verifies attacker-supplied JWTs or JWE data, these flaws could enable authentication bypass, token forgery acceptance, or denial of service.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
cp .env.example .env
# Edit .env with your settings
nano .env
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
cp .env.example .env
# Edit .env with your settings
nano .env
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
cp .env.example .env
# Edit .env with your settings
nano .env
The README exposes a destructive DELETE endpoint without documenting authorization requirements, confirmation controls, or ownership checks. In an agent-oriented API, under-specified destructive operations increase the chance of accidental or malicious deletion of agent accounts and associated mail data if access control is weak or misunderstood.
- `GET /health` - Health check
- `POST /agents` - Create agent (no auth)
- `GET /agents/{id}` - Get agent details
- `DELETE /agents/{id}` - Delete agent
- `POST /agents/{id}/send` - Send email
- `GET /agents/{id}/emails` - List inbox
- `GET /agents/{id}/sent` - List sent emails
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
STORAGE_LIMIT_MB: int = 1024 # 1GB per agent
class Config:
env_file = ".env"
case_sensitive = True
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
echo "Creating AI agent..."
response=$(curl -s -X POST "$API_BASE/agents" \
-H "Content-Type: application/json" \
-d '{
"id": "my-agent",
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
echo "Sending email..."
response=$(curl -s -X POST "$API_BASE/agents/$AGENT_ID/send" \
-H "Authorization: Bearer $QUIETMAIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
API_BASE="https://api.quiet-mail.com"
AGENT_ID="my-agent"
# Get API key from environment or file
if [ -z "$QUIETMAIL_API_KEY" ]; then
if [ -f ~/.quietmail_key ]; then
QUIETMAIL_API_KEY=$(cat ~/.quietmail_key)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
API_BASE="https://api.quiet-mail.com"
AGENT_ID="my-agent"
# Get API key from environment or file
if [ -z "$QUIETMAIL_API_KEY" ]; then
if [ -f ~/.quietmail_key ]; then
QUIETMAIL_API_KEY=$(cat ~/.quietmail_key)
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
echo "Fetching sent emails..."
response=$(curl -s "$API_BASE/agents/$AGENT_ID/sent?limit=10" \
-H "Authorization: Bearer $QUIETMAIL_API_KEY")
echo "$response" | python3 -m json.tool
The dependency pin fastapi==0.109.0 is flagged with a known security advisory, so keeping this exact version exposes the application to publicly documented weaknesses inherited from the framework. In a web API skill, framework vulnerabilities are directly reachable from untrusted network input, which increases practical exploitability.
Package name closely resembles a popular package, suggesting possible typosquatting. Attackers publish malicious packages with similar names to trick developers into installing them.
python-multipart==0.0.6 has multiple reported vulnerabilities including ReDoS and multipart boundary parsing DoS issues. Because this skill uses FastAPI and likely processes form or file uploads, malformed attacker-controlled Content-Type headers or multipart bodies could trigger excessive CPU consumption or request handling failures.
The code embeds a real SMTP username and password directly in source and uses them to send outbound email to an external service. Hardcoded credentials are highly sensitive secrets that can be reused by anyone with code access, enabling unauthorized mail sending, account abuse, spam, phishing, and possible lateral compromise if the password is reused elsewhere.
The code performs a real outbound email send using embedded credentials with no warning, consent, or runtime guard, which can enable unauthorized message transmission if the script is executed. In this context, the presence of live credentials makes the network action materially more dangerous because it can be immediately abused for impersonation, spam, or testing account compromise.
The test directly queries the database to retrieve live API keys, bypassing normal authentication controls and exposing secrets to any user or process able to run the test. Hardcoded database credentials combined with secret extraction make this especially risky if the file is reused outside an isolated local environment or committed into shared infrastructure.
def get_api_key(agent_id):
"""Get API key from database"""
conn = psycopg2.connect(DB_CONN)
cur = conn.cursor()
cur.execute('SELECT api_key FROM agents WHERE id = %s', (agent_id,))
Advertising 'No verification required' for an email-sending platform materially lowers barriers to automated account creation and abuse by agents. In the context of unlimited sending and agent automation, this increases the likelihood of spam, impersonation campaigns, and large-scale misuse if integrated without additional safeguards.
**Base URL:** `https://api.quiet-mail.com` (or `http://127.0.0.1:8000` for local)
**Philosophy:** Simple, unlimited email for AI agents. No verification required.
---
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
curl -X POST https://api.quiet-mail.com/agents \
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST https://api.quiet-mail.com/agents \
-H "Content-Type: application/json" \
-d '{
"id": "my-agent",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST https://api.quiet-mail.com/agents \
-H "Content-Type: application/json" \
-d '{
"id": "my-agent",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST https://api.quiet-mail.com/agents \
-H "Content-Type: application/json" \
-d '{
"id": "my-agent",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST https://api.quiet-mail.com/agents \
-H "Content-Type: application/json" \
-d '{
"id": "my-agent",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST https://api.quiet-mail.com/agents \
-H "Content-Type: application/json" \
-d '{
"id": "my-agent",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST https://api.quiet-mail.com/agents \
-H "Content-Type: application/json" \
-d '{
"id": "my-agent",
No suspicious patterns detected.