Back to skill

Security audit

成交加速器 / Deal Closer

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real CRM/email assistant, but it needs review because it can read and send mail and expose sensitive CRM data without enough confirmation or output controls.

Install only if you are comfortable granting this skill access to CRM records and mailbox credentials. Use a dedicated or least-privilege mailbox/app password where possible, keep DC_DATA_DIR private, review every outbound email manually before sending, and avoid running broad inbox scans or raw exports on sensitive accounts.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/utils.py:88
Finding

Sensitive CRM and Email Data Stored Without Restrictive Filesystem Permissions

Content
View full analysis
str: data_dir = os.environ.get("DC_DATA_DIR", DEFAULT_DATA_DIR) os.makedirs(data_dir, exist_ok=True) return data_dir ``` ```python def write_json_file(filepath: str, data: Any) -> None: """Write data to a JSON file.""" os.makedirs(os.path.dirname(filepath), exist_ok=True) with open(filepath, "w", encoding="utf-8") as f: json.dump(data, f, ensure_ascii=False, indent=2, default=str) ``` ### Technical Analysis The common storage functions create the application data directory and JSON files without explicitly applying restrictive permissions. The resulting access modes depend entirely on the process umask. Under a common umask such as `0022`, directories can be created as `0755` and files as `0644`. These files can contain commercially and personally sensitive information, including: - Customer names, email addresses, and telephone numbers - Deal values, stages, notes, and sales history - Email subjects, sender addresses, and message snippets - Meeting notes and action items - Follow-up schedules - CRM relationship graph data - Learned sales patterns The implementation also writes directly to the destination path. It does not reject symbolic links or use a securely created temporary file followed by an atomic replacement. In an environment where another local user can modify the selected data directory, this may permit symlink-based redirection or unintended overwriting of another file writable by the Skill process. This issue is especially relevant when `DC_DATA_DIR` points to a shared, group-writable, or otherwise untrusted location. ### Attack Path 1. The Skill runs on a multi-user host or inside an environment where its data directory is reada ...[truncated 1167 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imap_email.py:255
Finding

Mailbox Commands Return Unmasked Email Headers and Message Content

Content
View full analysis
Dict[str, Any]: subject = _decode_header_value(msg.get("Subject", "")) from_addr = _decode_header_value(msg.get("From", "")) to_addr = _decode_header_value(msg.get("To", "")) date_str = msg.get("Date", "") message_id = msg.get("Message-ID", "") parsed_date = "" if date_str: try: dt = email.utils.parsedate_to_datetime(date_str) parsed_date = dt.strftime("%Y-%m-%dT%H:%M:%S") except (ValueError, TypeError): parsed_date = date_str body = _extract_plain_text(msg) body_preview = body[:500] if body else "" return { "uid": msg_id, "message_id": message_id, "subject": subject, "from": from_addr, "to": to_addr, "date": parsed_date, "body_preview": body_preview, "body_length": len(body), } ``` Inbox retrieval directly returns the parsed records: ```python parsed = _parse_email_message(msg, mid.decode("utf-8")) emails_list.append(parsed) output_success({ "message": f"获取到 {len(emails_list)} 封邮件", "folder": folder, "total": len(emails_list), "emails": emails_list, }) ``` Search results use the same raw output pattern: ```python parsed = _parse_email_message(msg, mid.decode("utf-8")) emails_list.append(parsed) output_success({ "message": f"搜索到 {len(emails_list)} 封邮件", "search_criteria": search_str, "total": len(emails_list), "em ...[truncated 2942 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (40)

Tainted flow: 'req' from os.environ.get (line 243, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/email_scanner.py (reported line 164)May include surrounding context.

python
try:
        req = Request(url, headers=headers)
        with urlopen(req, timeout=30) as resp:
            data = json.loads(resp.read().decode("utf-8"))
            return data.get("messages", [])
    except (URLError, json.JSONDecodeError, Exception):

Tainted flow: 'req' from os.environ.get (line 243, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/email_scanner.py (reported line 190)May include surrounding context.

python
try:
        req = Request(url, headers=headers)
        with urlopen(req, timeout=30) as resp:
            data = json.loads(resp.read().decode("utf-8"))
            return data.get("messages", [])
    except (URLError, json.JSONDecodeError, Exception):

Tainted flow: 'req' from os.environ.get (line 243, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/email_scanner.py (reported line 244)May include surrounding context.

python
try:
        req = Request(url, headers=headers)
        with urlopen(req, timeout=30) as resp:
            data = json.loads(resp.read().decode("utf-8"))
            return data.get("messages", [])
    except (URLError, json.JSONDecodeError, Exception):

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The presence of undeclared active send/reply email capability is security-relevant because outbound communication can impersonate the user, leak data, or trigger business actions. If users expect analysis-only CRM behavior but the skill can also transmit emails, the mismatch increases the risk of unauthorized or accidental external actions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The presence of undeclared active send/reply email capability is security-relevant because outbound communication can impersonate the user, leak data, or trigger business actions. If users expect analysis-only CRM behavior but the skill can also transmit emails, the mismatch increases the risk of unauthorized or accidental external actions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

The presence of undeclared active send/reply email capability is security-relevant because outbound communication can impersonate the user, leak data, or trigger business actions. If users expect analysis-only CRM behavior but the skill can also transmit emails, the mismatch increases the risk of unauthorized or accidental external actions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The presence of undeclared active send/reply email capability is security-relevant because outbound communication can impersonate the user, leak data, or trigger business actions. If users expect analysis-only CRM behavior but the skill can also transmit emails, the mismatch increases the risk of unauthorized or accidental external actions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The presence of undeclared active send/reply email capability is security-relevant because outbound communication can impersonate the user, leak data, or trigger business actions. If users expect analysis-only CRM behavior but the skill can also transmit emails, the mismatch increases the risk of unauthorized or accidental external actions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The presence of undeclared active send/reply email capability is security-relevant because outbound communication can impersonate the user, leak data, or trigger business actions. If users expect analysis-only CRM behavior but the skill can also transmit emails, the mismatch increases the risk of unauthorized or accidental external actions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The presence of undeclared active send/reply email capability is security-relevant because outbound communication can impersonate the user, leak data, or trigger business actions. If users expect analysis-only CRM behavior but the skill can also transmit emails, the mismatch increases the risk of unauthorized or accidental external actions.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · assets/README.md (reported line 98)May include surrounding context.

步骤 4:设置环境变量

bash
export DC_GMAIL_CREDENTIALS="/path/to/gmail_credentials.json"

步骤 5:验证连接

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/email-setup-guide.md (reported line 33)May include surrounding context.

步骤 4:设置环境变量

bash
export DC_GMAIL_CREDENTIALS="/path/to/gmail_credentials.json"

步骤 5:验证连接

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill declares no explicit tool scope while documenting capabilities that require environment access, local file read/write, and network communication to external mail services. This creates an over-privileged and under-specified trust boundary, making it harder for a platform or user to understand and constrain what the skill may access.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The instruction says the agent must always communicate in Chinese, which imposes a fixed language policy regardless of user preference. This is a natural-language policy violation because it forces a specific language without offering choice or opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs scanning user mailboxes and linking messages to CRM records without strong user-facing privacy warnings, consent language, or data-handling boundaries. In a CRM context this is especially sensitive because business emails often contain confidential commercial data, personal contact information, and negotiation details.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documented inbox access, search, send, and reply operations lack explicit confirmation and warning requirements. Because this skill operates in a business communications context, unauthorized or accidental outbound email could cause data leakage, contractual misstatements, reputational harm, or phishing-like abuse from the user's account.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The behavior guideline states the assistant must always use Chinese, again enforcing a specific language without user selection. This duplicates the same locale restriction in the operational rules and does not provide an opt-in or alternative language path.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README advertises scanning Gmail/Outlook mail and extracting signals from message content, but it does not clearly warn users that the skill may access, parse, and retain sensitive mailbox data. In a CRM context, emails often contain customer PII, contracts, pricing, and internal discussions, so omission of an explicit privacy notice and consent boundaries creates real privacy and compliance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Documenting direct IMAP/SMTP connectivity 'without OAuth2' and 'works with any email provider' normalizes handling raw mailbox credentials without clearly warning about the sensitivity of those secrets or the breadth of account access they grant. If users configure primary inbox credentials, compromise or misuse could expose full mailbox contents and enable sending mail as the user.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The guide instructs users to enable mailbox scanning and signal extraction from Gmail/Outlook, but it does not clearly warn that this may process sensitive personal and business communications. In a CRM skill that analyzes emails, lack of an explicit privacy notice and consent guidance can lead to over-collection, unauthorized monitoring, or noncompliant handling of regulated data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python skill contains its primary description in Chinese and later emits user-facing success and error messages only in Chinese. Under the policy rule for language/locale constraints, forcing a specific language without user opt-in or a documented region-specific justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

delete_deal 会直接从商机列表中过滤掉目标记录并保存回 JSON 文件,属于不可逆的数据删除操作。虽然函数有简短 docstring 说明“删除商机”,但代码中没有任何确认提示、额外警告或显式提醒用户该操作会永久移除数据。

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The import function accepts an arbitrary caller-supplied file_path and reads any local file that exists, with no directory allowlist or file-type validation beyond attempting CSV parsing. In a skill environment, this broadens access from CRM operations to local filesystem reads, which can expose unrelated local data if the agent can be induced to import sensitive files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

import_deals 会读取任意提供的 CSV 路径并将其中联系人电话、邮箱等信息批量写入本地商机存储,属于文件读取和批量数据写入行为。当前仅说明需要 file_path,但没有向用户明确提示会导入并持久化敏感联系信息,也没有提醒批量导入可能影响现有数据集。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The export function writes full raw CRM records including contact_phone and contact_email to a file or stdout without applying the masking used elsewhere in the module. In an agent/skill context, this enables bulk exfiltration of customer PII far beyond the safer display behavior implemented for normal reads, increasing privacy and compliance risk.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.