T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/install.py:110- Finding
Persistent Full-Access Automation Installed Through Direct Database Modification
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill does build a Feishu email dashboard, but it should be reviewed because it installs persistent full-access automation and moves email-derived content into files, LLM translation, HTML, and Feishu messages.
Review before installing. Use --no-automation first, run --no-push for local preview, verify the Feishu open_id, and avoid using this on sensitive mailboxes unless you are comfortable with local email-derived files, LLM translation handling, and Feishu card/HTML delivery. Do not enable the default daily automation unless full-access persistent WorkBuddy automation is acceptable in your environment.
scripts/install.py:110Persistent Full-Access Automation Installed Through Direct Database Modification
scripts/gen_dashboard3.py:310Stored Script Injection Through Unsafe JSON Embedding in the Generated Dashboard
scripts/gen_dashboard3.py:813Attribute and Inline Event-Handler Injection in Dynamic Dashboard Markup
scripts/install.py:121Untrusted Email Content Is Passed to a Full-Access Translation Agent Without Prompt-Injection Isolation
The declared description presents a full end-user workflow: collecting recent Feishu emails, extracting multiple categories of business intelligence, generating translated/tiered summaries, producing an HTML dashboard, and pushing daily Feishu cards automatically. The supplied code chunk is a much narrower preprocessing script. Its purpose is to condense an already-prepared JSON inbox dataset into a smaller JSON containing selected threads for four stores using simple deadline/recent-activity filters. This is likely a supporting component in a larger pipeline, but by itself it does not implement the core declared functionality. The biggest discrepancies are the absence of Feishu access, absence of dashboard/card/HTML generation, absence of automation, and the 14-day local filtering behavior versus the promised 7-day mailbox summarization.
The description claims a complete end-to-end mail-board workflow: collecting recent Feishu emails, extracting store/business/delivery signals, producing Chinese summaries and deadline alerts, generating an HTML board, and automatically pushing daily Feishu cards. The actual code chunk is much narrower. It reads existing JSON files (cn_inbox.json / cn_inbox_full.json), prints compact thread content for LLM translation, validates translated entries with fields like summary/todos/risk, merges them into workboard2_cn.json, and shows counts. This translation-layer helper is related to one small described feature (Chinese summary translation), but it does not implement the skill’s primary declared behavior. Therefore the description materially overstates what this code chunk actually does.
该代码与声明有明显相关性:它确实围绕邮件整理看板数据,覆盖重点门店(科隆/罗马/杜塞/苏黎世)、西葡非建店业务,以及下单/交付/交期待办,并抽取进展、待办和DDL,属于“邮件看板”的后端数据整理部分。但声明描述的是一个完整技能:生成HTML看板、提供临期三档提醒、中文翻译、已回复按钮、飞书卡片推送以及自动化部署。实际代码只完成离线的数据提取与汇总,输出为JSON,没有任何飞书API调用、卡片推送、HTML生成、翻译、按钮交互或自动化注册实现。此外,声明强调“近7天邮件”,而代码最终输出窗口起始时间硬编码为2026-07-01,并未在此片段中体现7天筛选。因此,虽然主题方向一致,但声明显著高于代码实际能力,存在实质性描述与行为不匹配。
The declared description presents a complete end-user workflow: collecting recent Feishu email, building a dashboard, translating/summarizing, generating reminder tiers, producing self-contained HTML, and automatically pushing daily Feishu cards. The supplied code chunk is much narrower: it preprocesses existing JSON data into cn_inbox_full.json by selecting threads/items, stripping quoted text, and packaging fields for later LLM translation. While this supports part of the stated pipeline (preparing data for Chinese summarization of store/Iberia/todo emails), it does not itself implement the main advertised outputs or automations. Therefore the description materially overstates what this code chunk actually does.
Referenced artifact was not completely inspected
`gen_dashboard3.py` 的 `trSubj` 中文翻译表、`extract4.py` 的 `classify_store` 即可。
The script reads sensitive identifiers and mailbox settings from environment variables and config, then uses them to pull email content and push summaries/attachments to a chat recipient. In a skill context, undeclared environment/config access is dangerous because it can silently consume secrets or redirect data to an unintended recipient without an explicit permission boundary.
The file states '全部中文', which forces a specific language for generated output. Under the policy, locale or language constraints should either be optional for the user or clearly justified as a region-specific requirement; this file does not provide such opt-in or justification.
The deployment guide instructs users to configure a Feishu open_id and states that cards and @ reminders will be sent to that account, but it does not clearly warn that email-derived content and account identifiers will be transmitted to an external platform. Because this skill summarizes recent mailbox content and pushes it out automatically, users may expose internal or sensitive business information without informed consent or data-handling review.
The optional translation workflow tells users to hand generated content to an LLM for translation without warning that the exported cn_inbox.json is derived from mailbox data and may contain sensitive business communications. Sending such content to an external LLM service can create confidentiality, compliance, and retention risks, especially because the skill processes recent emails and business status items.
The --apply path merges user-provided translation data into an existing JSON file and then writes the result to workboard2_cn.json. Although the module docstring describes the data flow, the code path performs a persistent file write without a confirmation prompt or explicit user-facing warning that existing entries may be updated.
This wrapper invokes bash -lc to execute a constructed command string, which expands the attack surface beyond a direct subprocess.run([...]) call. Although each argument is shell-quoted, the effective executable is resolved through the shell and environment, and BASH_EXE itself is discovered from the user-controlled home directory, so a trojaned bash or manipulated runtime environment could cause arbitrary command execution while processing mailbox data.
def lark(args, timeout=120):
cmd = "lark-cli " + " ".join(shlex.quote(a) for a in args)
r = subprocess.run([BASH_EXE, "-lc", cmd], capture_output=True, text=True, cwd=WS, timeout=timeout)
if r.returncode != 0:
raise RuntimeError("lark-cli failed [%s]: %s" % (" ".join(args[:3]), r.stderr.strip()[:300]))
return r.stdout
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# ---------------- generate + send ----------------
def generate():
print("[3/5] extract4 -> workboard2_data.json")
subprocess.run([sys.executable, "extract4.py"], cwd=WS, check=True)
print("[4/5] gen_dashboard3 -> mail_workboard2.html")
subprocess.run([sys.executable, "gen_dashboard3.py"], cwd=WS, check=True)
# 生成待翻译清单(供 agent 在自动化里做 LLM 中文翻译/归纳)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
print("[3/5] extract4 -> workboard2_data.json")
subprocess.run([sys.executable, "extract4.py"], cwd=WS, check=True)
print("[4/5] gen_dashboard3 -> mail_workboard2.html")
subprocess.run([sys.executable, "gen_dashboard3.py"], cwd=WS, check=True)
# 生成待翻译清单(供 agent 在自动化里做 LLM 中文翻译/归纳)
if os.path.exists("prep_cn.py"):
try:
The pipeline intentionally condenses email bodies into translated summaries and dashboard content for later distribution, creating a built-in natural-language data exfiltration path. In a mailbox-processing skill, this is especially sensitive because emails commonly contain commercial, personal, or confidential operational data that may be forwarded more broadly than the original mailbox audience.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# 生成待翻译清单(供 agent 在自动化里做 LLM 中文翻译/归纳)
if os.path.exists("prep_cn.py"):
try:
subprocess.run([sys.executable, "prep_cn.py"], cwd=WS, check=True)
except Exception as e:
sys.stderr.write("prep_cn warn: %s\n" % e)
Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.
# 简易主题中文翻译(Python 兜底版,与 JS 的 trSubj 对齐;
# pick_summary 在 CN 缺失时调用,确保飞书 message 也能给点中文提示)
_RE_R = __import__('re').compile(r'^\s*(RE|Re|FW|Fw|FYI|AW|Aw|SV|VS|TR|FS|FBL|R)(\s*[::.\-]\s*)', __import__('re').I)
_TR_PAIRS = [
(r'DE[\s_]+POSM\b', '德国 POSM'),
(r'FR[\s_]+POSM\b', '法国 POSM'),
The generated digest/card explicitly includes translated summaries and main content meant for push delivery, which materially broadens exposure of mailbox information beyond the original email context. Given the skill is designed for automated daily pushes, this can repeatedly leak sensitive business details if the data is over-inclusive, mis-summarized, or sent to the wrong recipient.
This code sends email-derived summaries and an HTML attachment to a Feishu recipient using OPEN_ID from config/environment, without any in-file confirmation, recipient verification, or data-classification guardrail. Because the skill's purpose is to aggregate recent mail, a misconfigured or maliciously set recipient ID can exfiltrate business-sensitive mailbox content at scale through normal bot delivery channels.
The script serializes processed email-derived content into a local file, workboard2_data.json, including message metadata, participants, bodies, progress summaries, todos, and deadlines. In this skill's context, the data originates from recent business email and likely contains sensitive operational and personal information; writing it to disk without access controls, minimization, or explicit disclosure increases the risk of unintended retention, local exposure, or downstream exfiltration by other components.
The generated document hard-codes lang="zh-CN" and presents the primary interface title/content in Chinese, which imposes a specific language/locale choice on users. The file does not offer language selection or explain a justified region-specific constraint.
Untrusted email-derived data is serialized directly into an inline . An attacker controlling email subject, participant name, or body-derived fields could inject script-breaking content into the generated dashboard HTML, leading to stored XSS when the recipient opens the file.
This code file contains natural-language instructions entirely in Chinese, including the main module docstring and later user-facing prompts/output, with no opt-in or alternative locale. That creates a language-policy concern because the skill effectively requires a specific language for installation and operation guidance.
The installer tells users that leaving open_id blank means the board will only be generated locally without push, but it unconditionally writes push_enabled = True. In an automation/push skill, this configuration mismatch can cause later components to attempt delivery when the user believed push was disabled, leading to unintended disclosure or misrouting of email-derived summaries.
This is the same underlying security-relevant defect expressed through user-facing documentation: the code promises '留空=只本地生成不推送' yet persists a state that marks pushing as enabled. Because the skill processes recent email and can send Feishu cards/attachments automatically, misleading users about delivery state increases the risk of accidental data exposure.
The script exports mailbox-derived content into cn_inbox_full.json, including message excerpts, subjects, participants, and operational metadata, without any consent gate, minimization warning, or sensitivity controls. In this skill’s context, that data is then prepared for downstream translation/summarization workflows, which increases the chance of unnecessary exposure of personal, business, or confidential email content beyond the original mailbox.
No suspicious patterns detected.