Back to skill

Security audit

禅道Bug统计

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but it ships default ZenTao credentials and sends them over plaintext HTTP, which users should review before installing.

Install only if you are authorized to access the target ZenTao instance. Replace the embedded credentials, rotate the exposed password if it may be real, require user-supplied secrets, and use an HTTPS ZenTao URL before running it.

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
zentao_stats.py:26
Finding
Hard-Coded Default ZenTao Credentials## Vulnerability Details **File Location**: `zentao_stats.py`, lines 26–28 **Vulnerability Type**: Hard-coded credentials **Risk Level**: High ### Vulnerable Code ```python self.zentao_url = (zentao_url or os.environ.get('ZENTAO_URL', 'http://172.16.16.1:81/zentao/')).rstrip('/') + '/' self.username = username or os.environ.get('ZENTAO_USER', 'jinx_robot') self.password = password or os.environ.get('ZENTAO_PASS', '!!123Abc') ``` ### Technical Analysis The script embeds an operational username and password as fallback values. Environment-variable support does not mitigate this issue because the embedded values are automatically used whenever `ZENTAO_USER` or `ZENTAO_PASS` is absent. Secrets committed to source code can be recovered from distributed Skill packages, source archives, backups, logs, and repository history. If these credentials remain valid, possession of the source code is sufficient to attempt authentication against the configured ZenTao instance. ### Attack Path 1. An attacker obtains the Skill package, source archive, or repository contents. 2. The attacker reads `zentao_stats.py` and extracts the default ZenTao endpoint, username, and password. 3. The attacker connects to the exposed endpoint from a network location with access to it. 4. The attacker submits the recovered credentials to the ZenTao login interface. 5. If the credentials are valid, the attacker receives the permissions assigned to the `jinx_robot` account. No evidence in the reviewed files establishes the account's exact role, so administrative privileges cannot be assumed. ### Impact Assessment Successful exploitation may allow unauthorized access to the ZenTao account and all projects, bugs, metadata, and actions permitted to that account. Potential consequences include disclosure of internal defect information, unauthorized issue changes, and account misuse. The scope is limited by the account's configured privileges and the network accessibility of the ZenTao server ...[truncated 82 chars]
Remediation
## Remediation Suggestions 1. Remove all default usernames and passwords from source code. 2. Immediately rotate the exposed password and invalidate existing authenticated sessions. 3. Require credentials to be supplied through a protected runtime secret mechanism, such as a secret manager or securely injected environment variables. 4. Fail closed with a clear error if required credentials are missing; never fall back to operational credentials. 5. Restrict the service account to the minimum read-only permissions required for statistics collection. 6. Review repository history and distributed artifacts for the exposed secret, removing it where feasible. 7. Check authentication logs for unexpected use of the exposed account. 8. Add automated secret scanning to the development and release process. A safer configuration pattern is: ```python self.username = username or os.environ.get('ZENTAO_USER') self.password = password or os.environ.get('ZENTAO_PASS') if not self.username or not self.password: raise ValueError("ZENTAO_USER and ZENTAO_PASS must be configured securely") ```

T09 · Insecure Skill Coding Practices

Error
Location
zentao_stats.py:26
Finding
Credentials and Authenticated Session Transmitted over Plaintext HTTP## Vulnerability Details **File Location**: `zentao_stats.py`, lines 26–47 **Vulnerability Type**: Cleartext transmission of sensitive information **Risk Level**: High ### Vulnerable Code ```python self.zentao_url = (zentao_url or os.environ.get('ZENTAO_URL', 'http://172.16.16.1:81/zentao/')).rstrip('/') + '/' self.username = username or os.environ.get('ZENTAO_USER', 'jinx_robot') self.password = password or os.environ.get('ZENTAO_PASS', '!!123Abc') self.cookiejar = CookieJar() self.opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(self.cookiejar)) def _login(self) -> bool: """登录禅道""" self.opener.open(self.zentao_url, timeout=30) login_data = urllib.parse.urlencode({ "account": self.username, "password": self.password, "submit": "登录", }).encode('utf-8') req = urllib.request.Request( f"{self.zentao_url}user-login.html", data=login_data, headers={'Referer': self.zentao_url} ) self.opener.open(req, timeout=30) self.opener.open(self.zentao_url, timeout=30) ``` ### Technical Analysis The default ZenTao URL uses the unencrypted `http://` scheme. `_login()` places the username and password in a form-encoded POST request and sends it through the opener without enforcing HTTPS. Subsequent requests also use the same base URL and cookie jar. HTTP provides neither transport confidentiality nor authenticated server identity. An attacker able to observe or modify traffic between the client and ZenTao may read the submitted credentials, capture session cookies, modify responses, or impersonate the server. A user-supplied `ZENTAO_URL` can likewise use HTTP because the constructor performs no scheme validation. ### Attack Path 1. A user runs the script with its default URL or configures another plaintext HTTP endpoint. 2. The script sends the username and password to `user-login.html` over HTTP. 3. An attacker with a suitable network position—such as access to the ...[truncated 1015 chars]
Remediation
## Remediation Suggestions 1. Require an `https://` ZenTao endpoint and reject plaintext HTTP configurations. 2. Deploy a valid TLS certificate on the ZenTao server and retain Python's default certificate and hostname validation. 3. Remove the plaintext HTTP default rather than silently upgrading arbitrary URLs. 4. Rotate the exposed credentials after HTTPS is enabled, because they may already have traversed the network unencrypted. 5. Invalidate existing sessions and review access logs for suspicious activity. 6. Configure authentication cookies with `Secure`, `HttpOnly`, and appropriate `SameSite` attributes on the server. 7. Apply network restrictions so only authorized systems can reach the ZenTao service. 8. Consider token-based authentication with a narrowly scoped, read-only token if supported. For example: ```python configured_url = zentao_url or os.environ.get('ZENTAO_URL') if not configured_url: raise ValueError("ZENTAO_URL must be configured") parsed_url = urllib.parse.urlparse(configured_url) if parsed_url.scheme != 'https' or not parsed_url.hostname: raise ValueError("ZENTAO_URL must be a valid HTTPS URL") self.zentao_url = configured_url.rstrip('/') + '/' ```
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script reads credentials from environment variables and also embeds default credentials, then uses them to authenticate over HTTP to an internal Zentao instance. This is dangerous because the login transmits secrets without transport encryption and the hardcoded fallback credentials create a high risk of credential exposure, reuse, and unauthorized access if the script is shared or run in a monitored environment.

Natural-Language Policy Violations

Low
Confidence
78% confidence
Finding
The natural-language instructions, headings, parameter descriptions, and examples are presented only in Chinese. If organizational policy requires avoiding forced language selection without user opt-in, this can be considered a locale/language policy issue because no alternative language or opt-in is offered.

Missing User Warnings

Low
Confidence
84% confidence
Finding
This markdown file describes a workflow that logs into ZenTao and performs POST requests to retrieve bug statistics. While the behavior is shown in the example output and implementation summary, there is no explicit user warning about network activity, authentication, or potential handling of project data.

Natural-Language Policy Violations

Low
Confidence
85% confidence
Finding
The natural-language description and user-facing strings in this file are entirely in Chinese, and the tool does not appear to offer any language or locale selection. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Static analysis

No suspicious patterns detected.