Back to skill

Security audit

Egatee Chat Summary

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says by fetching Egatee IM chat history, but it handles sensitive chat data and credentials with under-scoped network and local configuration controls.

Install only if you control the Egatee API key, have authorization to process the account's chats, and can restrict configuration. Avoid run.sh unless .env is trusted and locked down, do not set EGATEE_NOTIFY_BASE_URL except to an approved HTTPS Egatee host, avoid EGATEE_AUTH_TOKEN unless required, and treat outputs as private chat data.

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

Error
Location
tool.py:24
Finding

API credentials can be transmitted to arbitrary or plaintext endpoints

Content
View full analysis
str: """ 根据 apiKey 前缀自动选择环境: - uat_* -> http://api.uat.egatee.net - 其他 -> https://api.egatee.com """ k = (api_key or "").strip() if k.lower().startswith("uat_"): return "http://api.uat.egatee.net" return "https://api.egatee.com" def get_notify_base_url(api_key: str) -> str: # 允许显式覆盖(比如临时走 matata-global 域名/私有网关) explicit = get_optional_env("EGATEE_NOTIFY_BASE_URL") if explicit: return explicit.rstrip("/") inferred = infer_base_url_by_api_key(api_key).rstrip("/") _debug_log(f"EGATEE_NOTIFY_BASE_URL not set, inferred base_url={inferred}") return inferred ``` ```python def build_headers(api_key: str = "", auth_token: str = "") -> Dict[str, str]: headers = {"Content-Type": "application/json"} if api_key: headers["X-API-Key"] = api_key if auth_token: headers["Authorization"] = f"Bearer {auth_token}" # 用于后端日志定位(CommonConstant.REQUEST_ID = "ADMIN_REQUEST_ID") request_id = os.getenv("EGATEE_REQUEST_ID", "").strip() if not request_id: request_id = uuid.uuid4().hex headers["ADMIN_REQUEST_ID"] = request_id return headers ``` ```python def post_json(url: str, headers: Dict[str, str], body: Dict[str, Any], timeout: int) -> Dict: try: _debug_log(f"HTTP POST {url}") _debug_log(f" headers={json.dumps(_redact_headers(headers), ensure_ascii=False)}") _debug_log(f" body={json.dumps(body, ensure_ascii=False)}") resp = requests.post(url, headers=headers, data=json.dumps(body), timeout=timeout) ``` ```python base_url = get_notify_base_url(api_key) headers = build_headers(api_key=api_key, auth_token=au ...[truncated 3090 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
run.sh:10
Finding

Automatic sourcing of .env permits arbitrary shell command execution

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill description understates sensitive behavior: it accesses external chat-history APIs using API-key credentials and handles private message data, but this capability is not clearly and narrowly declared. That mismatch can mislead reviewers and users about the degree of data access, increasing the risk of unintended disclosure of chat contents and metadata.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
96% confidence
Finding

The script sources a local .env file as shell code, not as passive configuration data. If an attacker can modify or replace .env, arbitrary commands will execute with the privileges of the script, and any credentials in that file are also loaded into the environment for downstream processes.

Content

Scanner excerpt · run.sh (reported line 11)May include surrounding context.

sh
DAY="${1:-1}"

if [[ -f ".env" ]]; then
  # shellcheck disable=SC1091
  source ".env"
fi

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Because .env is sourced immediately before invoking python3 tool.py, any secrets loaded from the file are inherited by the Python process and any malicious shell statements in .env will already have executed. In a skill that accesses IM chat records, this increases sensitivity because credentials may grant access to private communications and could be exfiltrated or abused.

Content

Scanner excerpt · run.sh (reported line 13)May include surrounding context.

sh
if [[ -f ".env" ]]; then
  # shellcheck disable=SC1091
  source ".env"
fi

python3 tool.py --day "${DAY}"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README explicitly describes pulling 1–7 days of IM chat history, which is inherently likely to contain sensitive personal or business data, but it provides no warning, consent guidance, retention expectations, or safe-handling instructions. In this context, the omission increases the chance that operators will collect and process private conversations without adequate notice or safeguards, creating privacy and compliance risk.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill declares no explicit tool scope or permissions even though it requires environment secrets and performs outbound network access. This weakens reviewability and consent boundaries, making it easier for a user or platform to invoke a data-accessing skill without a clear declaration of its capabilities.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The markdown advertises fetching 1-7 days of chat history and exposing peer summaries, including identifiers like peerNick and peerAvatar, without any privacy warning or consent guidance. Because chat logs are highly sensitive interpersonal data, missing privacy notice and purpose limitation materially raises the chance of unauthorized collection, over-sharing, or policy violations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The docstring explicitly states that the tool generates a Chinese Markdown report, and the generated section headings and labels are all fixed in Chinese. This imposes a language choice on users without offering an option to select locale or output language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The tool retrieves and transmits potentially sensitive chat history and associated metadata to a remote API without any built-in notice, consent gate, or minimization controls. In this skill context, the data is highly privacy-sensitive, so silent collection/export increases the risk of unauthorized surveillance, policy violations, and accidental exposure of private communications.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest says the skill '拉取IM账号近1-7天聊天记录并生成汇总分析', implying both retrieval and synthesized summary/analysis. In execution, the code fetches chat history and prints only metadata plus peer_summaries containing copied message text samples; the summarize() and build_report_markdown() helpers that would generate actual summary output are never used.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The visible instructional content is presented in Chinese only, with no alternative language option or note that the skill is intentionally limited to Chinese-speaking users. This can constitute a language/locale policy issue when the skill implicitly forces a specific language without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency is specified as requests>=2.31.0, which permits installation of any later version without ensuring a reviewed, reproducible release. This weakens supply-chain control and makes it impossible to verify exactly which version will be installed, increasing the chance of pulling in a vulnerable or incompatible release over time.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
requests>=2.31.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding

Because requests is not pinned, the manifest does not establish whether deployment will use a version affected by one of the known advisories. In a skill that pulls recent IM chat records, any dependency issue involving credential leakage, TLS/verification problems, or request handling could expose sensitive chat data or access tokens if an affected version is installed.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.