Back to skill

Security audit

ai-zidong-tibug

Security checks for vulnerabilities and agentic risk

Overview

This skill is legitimate ZenTao bug-filing automation, but it defaults to live ticket submission and has under-scoped handling of credentials, tokens, and local attachments.

Install only for a controlled Chinese ZenTao workflow where you trust the target URL and inputs. Use dry-run or explicit confirmation before live submission, provide credentials through a secure secret mechanism rather than CLI flags, set ZENTAO_URL explicitly, keep SSL verification enabled, restrict attachment paths to user-selected evidence files, and protect or delete the saved token state file.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/zentao_submit_bugs.py:692
Finding

Unrestricted Local File Upload Through Attachment Paths

Content
View full analysis
Dict[str, Any]: result: Dict[str, Any] = { "source": file_path, "status": "failed", "fileId": None, "url": None, "error": None, } path = Path(file_path).expanduser() if not path.exists() or not path.is_file(): result["error"] = "附件文件不存在" return result mime_type, _ = mimetypes.guess_type(str(path)) mime_type = mime_type or "application/octet-stream" try: with path.open("rb") as f: response = client.request( "POST", "/files", data={"objectType": "bug", "objectID": str(bug_id)}, files={"imgFile": (path.name, f, mime_type)}, ) if response.status_code != 200: result["error"] = f"上传失败 HTTP {response.status_code}: {response.text[:200]}" return result data = response.json() if data.get("status") != "success": result["error"] = f"上传失败: {data}" return result file_id = data.get("id") or data.get("data", {}).get("id") ext = extract_file_extension(path.name) file_url = ( f"{client.cfg.base_url}/index.php?m=file&f=read&t={ext}&fileID={file_id}" if file_id else (data.get("url") or "") ) result.update( { "status": "success", "fileId": file_id, "url": file_url, } ) return result except Except ...[truncated 2696 chars]
Remediation
View remediation
/attachments`, and reject files outside that directory. 2. Resolve each candidate path with `Path.resolve()` and verify containment using `relative_to()` or an equivalent canonical-path check. 3. Reject absolute paths, path traversal, symbolic links, device files, sockets, and other non-regular inputs. 4. Allow only necessary attachment formats, such as PNG, JPEG, WebP, MP4, and approved document types. 5. Validate actual file signatures instead of relying exclusively on filename extensions. 6. Enforce per-file and aggregate upload-size limits. 7. Display the resolved path, size, and destination for each attachment before upload and require explicit approval for generated or externally supplied paths. 8. Exclude sensitive filenames and directories such as `.env`, `.ssh`, cloud credential directories, token-state files, and Agent configuration locations. 9. Consider accepting file handles or attachments explicitly selected by the user rather than arbitrary path strings in bug JSON. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/zentao_login_and_save_state.py:82
Finding

Bearer Authentication Token Stored Without Restrictive File Permissions

Content
View full analysis
None: path.parent.mkdir(parents=True, exist_ok=True) path.write_text(json.dumps(state, ensure_ascii=False, indent=2), encoding="utf-8") ``` ```python state = { "formatVersion": 2, "provider": "zentao-v1-token", "zentaoUrl": config["url"], "token": token, "account": config["username"], "savedAt": datetime.now(timezone.utc).isoformat(), } save_path = Path(config["storage_state_path"]).expanduser().resolve() save_state(save_path, state) ``` The submission client independently performs the same type of storage: ```python def save_state(self) -> None: if not self.token: return self.cfg.state_path.parent.mkdir(parents=True, exist_ok=True) payload = { "formatVersion": 2, "provider": "zentao-v1-token", "zentaoUrl": self.cfg.base_url, "token": self.token, "account": self.cfg.zentao_user, "savedAt": datetime.now(timezone.utc).isoformat(), } self.cfg.state_path.write_text( json.dumps(payload, ensure_ascii=False, indent=2), encoding="utf-8" ) ``` ### Technical Analysis Both scripts persist a reusable ZenTao bearer token in plaintext. `Path.write_text()` creates or replaces the file using permissions controlled by the current process umask. The code does not explicitly require mode `0600`, harden the parent directory, inspect existing ownership or permissions, or reject symbolic links. If the runtime has a permissive umask, the state file may be readable by other local users. If an attacker can pre-create the destination as a symbolic link, the write may also target an unintended file accessible to the process. ...[truncated 1372 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/zentao_submit_bugs.py:1149
Finding

Credentials Can Be Exposed Through Unsafe Endpoint, TLS, and Command-Line Configuration

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose centers on transforming bug text and automatically creating ZenTao defects one by one. The supplied code does none of the text-processing or submission behavior. Its sole function is authentication: it reads credentials from environment variables, requests a ZenTao API token, and writes that token plus metadata to a storage-state JSON file. While login could be a supporting step for later submission, this chunk by itself has a materially different primary purpose and omits the core advertised functionality. It also accesses credentials and writes auth state locally, which is not reflected in the declared permissions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

代码的核心确实包含‘自动登录禅道并逐条提交缺陷’这一部分,且会对字段做一定归一化(如步骤、严重级别、优先级、默认值补全)。但声明中的主要卖点是把零散/口语化/评审纪要中的缺陷描述整理成可执行、可复现、可验收的‘一句话 Bug’,这类文本理解、改写和标题生成能力在代码中并未实现。代码只接受 JSON/JSONL 的结构化输入,提取 title、steps、expectation 等字段后直接提交,最多是字段标准化,不是从自由文本中生成规范化 Bug 描述。此外,声明提到‘未指明平台时默认安卓’,代码没有平台字段处理或安卓默认前缀逻辑。相反,代码还包含若干声明未提及的实质功能:标题去重、模块规则映射、两套禅道提单方式、附件上传和链接回填、token 持久化等。因此描述只部分覆盖了真实行为,且遗漏了输入前提与主要实现边界,构成明显不匹配。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill instructs the agent to use environment variables, read and write local files, and interact with external systems, but it declares no explicit tool scope or permission boundaries. That creates an over-privileged, opaque execution model where operators and policy layers cannot easily constrain credential access, filesystem writes, or network side effects.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The description mandates normalization into a Chinese-language '一句话 Bug' format and says each output must use ZenTao ticket style, but it does not offer the user any language or locale choice. This is a natural-language policy issue because it imposes a specific language/locale behavior without opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill defaults to logging into ZenTao and creating external tickets unless the user explicitly opts out. In this context, the side effect is materially dangerous because it can cause unauthorized or accidental actions in a production bug-tracking system, including spam, data leakage in tickets, or workflow disruption.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill requires credential-bearing environment variables for automatic login but provides no explicit warning or safeguards around sensitive secret handling. In a skill designed to automate access to a real external system, this increases the chance of improper credential exposure, misuse, or execution in environments where secrets are more broadly accessible than intended.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The config uses Chinese-only matching strings and keywords such as "短视频-搜索界面", "社区", and "我的-问卷调查" with no indication that the skill is region-specific or that users can choose another language. This creates a natural-language locale constraint that may violate policy when applied outside a clearly justified Chinese-only context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The example JSON uses Chinese-only field names and values throughout, such as the keys at L04-L20 and the sample text content. This can constitute a language/locale policy violation because it implicitly requires a specific language without any documented opt-in or justification for a region-specific use case.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The template explicitly instructs the agent to use credential environment variables, run an automated login script, and submit bugs to a live ZenTao instance, but it does not require explicit user confirmation, environment validation, or safeguards against unintended external actions. In an agent setting, this can cause unauthorized use of stored credentials, accidental modification of production tracking systems, and bulk creation of issues from untrusted or malformed input.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script persists a live ZenTao authentication token to disk in plaintext JSON, which can be read by other local users, leaked via backups, or accidentally committed if the path is under the project workspace. In the context of a skill that automatically logs in and submits bugs, compromise of this token could let an attacker impersonate the user and create, modify, or access defect data without needing the original password.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
67% confidence
Finding

The description says that when the platform is unspecified, the skill defaults to Android. While not strictly a language choice, it is a fixed default workflow assumption expressed in natural language that may conflict with user intent if not confirmed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The function sends HTTP basic-auth credentials and ZenTao username/password to a remote endpoint, which is a sensitive network operation. The file documents required environment variables, but it does not clearly warn users that running the script will transmit those credentials to the configured server.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The success messages are hard-coded in Chinese, which imposes a specific language on all users. The file does not offer an opt-in language selection or explain that the script is intentionally limited to a Chinese-speaking environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code file contains natural-language defaults and user-visible output that assume Chinese locale, such as the default assignee and many status/error strings elsewhere in the script. Under the policy, forcing a specific language/locale without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.