T05 · Unauthorized Access and Privilege Escalation
- Location
main.py:63- Finding
Unauthenticated Dashboard Exposes Sensitive Customer and Ticket Data
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a real email automation tool, but it can send customer emails automatically and exposes stored customer ticket data through an unauthenticated dashboard.
Review this carefully before installing. Use only test mailboxes at first, disable or gate automatic SMTP replies until reviewed, bind the dashboard to localhost with authentication, avoid exposing ticket APIs, redact customer data before LLM/webhook use, and pin or verify dependencies for production use.
main.py:63Unauthenticated Dashboard Exposes Sensitive Customer and Ticket Data
dashboard.html:370Stored Cross-Site Scripting Through Unescaped Ticket Data
${t.ticket_id}
${t.from_name || t.from_addr}
${CATEGORY_LABELS[t.category] || t.category}
${SENTIMENT_LABELS[t.sentiment] || t.sentiment}
${'🔴'.repeat(t.urgency_level || 0)}${'⚪'.repeat(5 - (t.urgency_level || 0))}
${t.escalation_level}
${t.escalation_reason || ''}
${(t.created_at || '').slice(11,16)}
`;
}).join('');
}
```
```javascript
function renderRecentTable(tickets) {
const tbody = document.getElementById('recentTable');
if (!tickets.length) {
tbody.innerHTML = '暂无工单';
return;
}
tbody.innerHTML = tickets.map(t => {
const statusBadge = t.status === 'AUTO_REPLIED' ? 'badge-green' :
t.status === 'ESCALATED' ? 'badge-red' :
t.status === 'RESOLVED' ? 'badge-blue' :
t.
...[truncated 2784 chars]agent/classifier.py:75Excessive Disclosure of Customer PII to Configurable LLM Endpoints
agent/classifier.py:35Prompt Injection Through Attacker-Controlled Email Content
requirements.txt:1Unpinned Python Dependencies and Unverified Remote Dashboard Script
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
cp .env.example .env
# 编辑 .env,填入 LLM_API_KEY (OpenAI 兼容)
# 编辑 config.yaml,填入 IMAP/SMTP 服务器信息
Exposing a local HTTP dashboard/API and operational commands is a meaningful expansion of attack surface beyond a simple email assistant. If these capabilities are not disclosed up front, operators may run the skill in environments where local web exposure, data leakage through stats endpoints, or unintended admin/test actions become possible.
Exposing a local HTTP dashboard/API and operational commands is a meaningful expansion of attack surface beyond a simple email assistant. If these capabilities are not disclosed up front, operators may run the skill in environments where local web exposure, data leakage through stats endpoints, or unintended admin/test actions become possible.
Exposing a local HTTP dashboard/API and operational commands is a meaningful expansion of attack surface beyond a simple email assistant. If these capabilities are not disclosed up front, operators may run the skill in environments where local web exposure, data leakage through stats endpoints, or unintended admin/test actions become possible.
Exposing a local HTTP dashboard/API and operational commands is a meaningful expansion of attack surface beyond a simple email assistant. If these capabilities are not disclosed up front, operators may run the skill in environments where local web exposure, data leakage through stats endpoints, or unintended admin/test actions become possible.
Exposing a local HTTP dashboard/API and operational commands is a meaningful expansion of attack surface beyond a simple email assistant. If these capabilities are not disclosed up front, operators may run the skill in environments where local web exposure, data leakage through stats endpoints, or unintended admin/test actions become possible.
Exposing a local HTTP dashboard/API and operational commands is a meaningful expansion of attack surface beyond a simple email assistant. If these capabilities are not disclosed up front, operators may run the skill in environments where local web exposure, data leakage through stats endpoints, or unintended admin/test actions become possible.
This path sends raw customer identity fields, subject, and email body content to the external LLM to generate a reply. Because it includes directly identifying information and unstructured message text, it materially increases exposure of PII and potentially financial/order data, making the issue more severe than generic template polishing.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
print("=" * 60)
print("\n💡 提示:")
print(" 1. 配置 .env 文件中的 LLM_API_KEY 后,可真实调用 LLM 分类")
print(" 2. 配置 IMAP/SMTP 后,运行 'python main.py run' 启动真实 Agent")
print(" 3. 运行 'python main.py dashboard' 查看监控看板")
The README presents the system as a fully automatic pipeline that fetches customer email, classifies content with an LLM, and sends SMTP replies, but does not prominently warn that this can process real customer data and generate outbound communications without human review. In this context, operators may connect production mailboxes and enable autonomous handling too early, creating privacy, compliance, and customer-impact risk from misclassification or unsafe responses.
The run instructions explicitly tell users how to start continuous live processing against IMAP/SMTP, but omit any warning that this may connect to production inboxes and send automatic replies to real customers. That omission is risky because it lowers operator caution and can lead to unintended mass outbound email, mishandled complaints, or exposure of sensitive customer content to the LLM and downstream systems.
The skill declares required binaries and sensitive environment variables, and its documented commands imply filesystem and network activity, but it does not declare an explicit tool/permission scope. This creates a transparency and containment problem: a reviewer or runtime may not realize the skill can access secrets, read configuration, and communicate over IMAP/SMTP or HTTP, increasing the chance of over-privileged execution.
The manifest description is written in Chinese and the file does not indicate that language selection is optional or region-specific. Under the policy, forcing a specific language without user opt-in can be a locale/language policy violation.
A skill that can process and potentially send replies to real emails should clearly warn users that it may act on live mailbox data and generate outbound communications. Without an explicit warning, users may test or deploy it against production inboxes without understanding the operational and privacy consequences, leading to accidental customer contact or mishandling of sensitive content.
The agent changes mailbox state by calling mark_read in multiple paths, which is a user-data affecting operation. While there are operational logs, this file does not clearly disclose in comments or docstrings that running the agent will modify message read status, including on failures and filtered messages.
This code sends outbound emails automatically via self.sender.send(...), which is a safety-relevant external action affecting user communications. Although the file logs processing status, it does not include a clear warning, confirmation step, or explicit disclosure in comments/docstrings that the skill will autonomously transmit replies to external recipients.
The classifier sends full email content, sender identity, and subject line to an external LLM service, which can expose sensitive personal, financial, or business information to a third party. In an e-commerce customer support context, emails may contain order IDs, addresses, refund details, complaints, and other PII, so forwarding them off-platform without explicit notice, consent, or minimization creates a real privacy and compliance risk.
The module docstring and function docstring are written entirely in Chinese, which imposes a specific language on users and maintainers without any opt-in or justification that the skill is intended only for a Chinese-language environment. The policy explicitly flags language or locale constraints when no user choice or documented rationale is provided.
The notification path sends customer-identifying and case-content data to external WeCom/Feishu webhooks, including name, email address, summary, sentiment, and possible order identifiers. In a customer support email agent, this materially increases privacy and data-leak risk because webhook endpoints may be third-party managed, misconfigured, or exposed outside the intended trust boundary.
This code transmits escalation messages containing customer metadata and ticket details to an external webhook URL using requests.post(). In the context of an email support agent processing potentially sensitive customer communications, such exfiltration can leak personal data and business-sensitive information if the webhook is compromised, misdirected, or points to an untrusted SaaS tenant.
"msgtype": "markdown",
"markdown": {"content": message.replace("\n", "\n> ")},
}
requests.post(self.wecom_webhook, json=payload, timeout=10)
except Exception as e:
print(f"[WARN] 企微通知发送失败: {e}")
This second webhook transmission sends the same class of potentially sensitive escalation content to Feishu. Because the message includes customer identity and case details, the external transmission broadens the attack surface and can violate privacy or data-handling requirements if endpoint governance is weak.
"msg_type": "text",
"content": {"text": message},
}
requests.post(self.feishu_webhook, json=payload, timeout=10)
except Exception as e:
print(f"[WARN] 飞书通知发送失败: {e}")
This code reads SMTP username and password from configuration and later uses them to authenticate and send email over the network. While the docstrings describe sending mail, there is no user-facing confirmation, warning, or logging that credentials will be used and message content transmitted externally.
The LLM polishing prompt is always written in Chinese (请将以下客服邮件回复翻译为 {lang} 语言), regardless of operator preference or deployment locale. This imposes a specific language in natural-language instructions without any opt-in or documented justification, which matches the language/locale policy violation category.
The code sends full email reply content to an external LLM for translation/polishing without any indication of consent, minimization, or privacy controls. In a customer-support context, the body can contain personal, order, or complaint data, so transmitting it to a third-party model provider creates a real confidentiality and compliance risk.
The prompt embeds raw customer identity and message content and asks the LLM to process and reproduce that data in generated replies. This creates prompt-injection and privacy risks: hostile email text can steer the model, and sensitive user data is unnecessarily exposed to the provider and may be echoed back into outputs.