Back to skill

Security audit

Zentao Work Stats

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed read-only Zentao reporting tool, but it can load broader employee and project metadata than a single-user report needs.

Install only if the database account is dedicated, read-only, and limited to the minimum tables/columns needed. Confirm authorization for the target employee and report period, restrict generated report storage and sharing, and consider narrowing the mapping queries before use.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (1)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:142
Finding

Unbounded Collection of Employee and Project Metadata

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 142–148
Vulnerability Type: Excessive database access beyond the stated reporting scope
Risk Level: Medium

Vulnerable Code

python
cursor.execute("SELECT id, name FROM zt_product")

cursor.execute("SELECT id, name, project FROM zt_execution")

cursor.execute("SELECT account, realname FROM zt_user")

Technical Analysis

The skill is intended to analyze one specified user over a specified time range. However, these queries retrieve every product, execution, user account, and real name available to the configured database account. They contain no filtering based on the target user, relevant work-item identifiers, authorized organizational scope, or requested reporting period.

This violates data-minimization and least-privilege principles. The issue is particularly sensitive for zt_user, because it exposes the identity directory of unrelated employees even when only one employee is being analyzed. Although the documented database account is read-only, read-only access does not prevent unauthorized disclosure or excessive collection.

Attack Path

  1. An operator activates the skill and supplies a target user and reporting period.
  2. The skill connects to the Zentao database using the configured read-only account.
  3. During preliminary mapping, it executes the unfiltered queries.
  4. The database returns all accessible user identities, products, and execution metadata rather than only records associated with the requested report.
  5. The unrelated information is loaded into the agent context and may be retained in logs, intermediate state, or generated output.
  6. A user able to invoke the skill could consequently obtain organizational metadata outside the legitimate scope of the report, subject to the database account's existing SELECT permissions.

Impact Assessment

The issue does not grant database write access, operating-system ...[truncated 623 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace database-wide mapping queries with queries restricted to identifiers referenced by the selected user's in-scope work records.
  2. Query only the selected user's identity directly:
    python
    cursor.execute(
        "SELECT account, realname FROM zt_user WHERE account = %s",
        (user,)
    )
    
  3. Build the relevant product and execution ID sets from the already authorized story, task, and bug results, then use parameterized IN queries to retrieve only those mappings.
  4. Apply the requested time range when identifying relevant actions and work objects before loading metadata.
  5. Configure a dedicated database role that can read only the required columns and tables. Where practical, expose restricted database views rather than granting access to complete tables.
  6. Add explicit authorization checks for the target employee and organizational scope before issuing queries.
  7. Avoid including unrelated mapping data in reports, logs, exceptions, or agent context, and securely delete intermediate data after report generation.
  8. Add tests that fail if a single-user report executes an unfiltered query against zt_user, zt_product, or zt_execution.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (4)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 43)May include surrounding context.

md
从 `config.json` 读取连接信息。配置文件路径:与本 SKILL.md 同目录下的 `config.json`。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 113)May include surrounding context.

md
从 `config.json` 读取连接信息。配置文件路径:与本 SKILL.md 同目录下的 `config.json`。

Ae2

Medium
Category
analysis-evasion
Confidence
90% confidence
Finding

Artifact content does not match its filename extension

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The template title and instructions are written to produce the report in Chinese, and the structure consistently requires Chinese labels and translated status values. This imposes a specific language/locale on output without any user opt-in or documented justification, which matches the language-policy violation criterion.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.