Back to skill

Security audit

zhuocha

Security checks for vulnerabilities and agentic risk

Overview

The skill fits a bid-duplicate review workflow, but it can write to internal result tables and documents unsafe database operations that need careful review before installation.

Install only if you trust the internal database environment and intend agents to make persistent duplicate-analysis writebacks. Before use, remove or gate the TRUNCATE recovery instruction, require an explicit preview-and-confirm step before any insert, prefer parameterized or scoped API calls for all queries, and use authenticated HTTPS or another protected channel for the internal services.

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/zhuocha_finder.py:52
Finding

Second-Order SQL Injection Through Interpolated Database Identifiers

Content
View full analysis
= {min_count} AND COUNT(*) <= {max_count} ORDER BY cnt DESC LIMIT {limit} """ else: sql = f""" SELECT reid, COUNT(*) as cnt FROM {TABLE_RE} WHERE reid NOT IN ({','.join(f"'{r}'" for r in done)}) GROUP BY reid HAVING COUNT(*) = {min_count} ORDER BY RANDOM() LIMIT {limit} """ ``` ```python def get_jy_fields(reid): """获取分组内所有 jy_id 的字段""" sql = f""" SELECT jy_id, customer_standard_new, title, proj_name, type FROM {TABLE_RE} WHERE reid = '{reid}' ORDER BY jy_id """ result = rp(API_6100, {"sql": sql}) if result and result.get("success"): return result["data"] return [] def get_detail(jy_id, limit=200): """获取原始正文前 N 字""" sql = f"SELECT LEFT(detail, {limit}) as detail, att_ext FROM public.ods_bid_content WHERE jy_id = '{jy_id}'" result = rp(API_5100, {"sql": sql}) ``` ### Technical Analysis The script embeds `reid` and `jy_id` values directly into SQL string literals without parameterization or escaping. These values are obtained from database-backed API responses and subsequently reused in new SQL statements. This creates a second-order SQL-injection vulnerability: a malicious value stored in the source database can become executable SQL when processed by the script. The `done` collection is similarly expanded into a `NOT IN` clause by surrounding each untrusted value with quotes. A quote embedded in any stored identifier can terminate the intended string literal and change the query structure. The consequ ...[truncated 1689 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:77
Finding

Unsafe Full-Table Truncation Recommended as an Error-Recovery Procedure

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/zhuocha_finder.py:21
Finding

Sensitive Business Data and SQL Transmitted Over Plaintext HTTP

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

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared purpose emphasizes duplicate-analysis data sources, but the body also instructs persistent writes to result.dify_ns_re_result and references operational recovery actions that materially change system state. This mismatch is dangerous because reviewers or users may authorize the skill for analysis while unintentionally granting write access to production-like resources not clearly disclosed in the high-level description.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill documents TRUNCATE TABLE result.dify_ns_re_result as a recovery path, which is a destructive full-table operation, without a hard confirmation workflow, authorization check, or safer scoped alternative. In this skill's context, that is especially dangerous because it targets a shared results table and could erase all prior analysis state due to a single formatting or duplicate-write mistake.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill includes explicit network/database access instructions but does not declare any tool scope or allowed-tools boundary. This weakens least-privilege controls and can let an agent invoke broader capabilities than users or reviewers expect, especially because the skill also reaches internal HTTP endpoints and databases.

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 direct insertion of analysis results into a live API/database but does not require a user-facing confirmation or prominently warn that the action modifies persistent data. In this context, the danger is elevated because duplicate-analysis is partly judgment-based, so an agent could persist incorrect deletions/retention decisions into operational result tables without explicit approval.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring says this script supports a workflow of manual analysis followed by Python writing results, and the usage text implies it processes records. However, the actual main flow only fetches data, prints summaries, and accumulates in-memory results; it never captures user confirmation or calls the write functions, so the implemented behavior is narrower than the documented behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script sends bid identifiers, metadata, and content excerpts to internal services over plain HTTP, which lacks transport encryption and integrity protection. Anyone with network position on the internal segment could observe or tamper with queried data or returned results, which is especially sensitive in a bid-analysis workflow.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

This helper performs outbound HTTP POST requests carrying SQL queries and receiving potentially sensitive business data, creating an external transmission surface. In the context of this skill, that transmission is core functionality, but it is still security-relevant because it exposes bid-related data to network interception and enables trust in remote responses without strong transport assurances.

Content

Scanner excerpt · scripts/zhuocha_finder.py (reported line 33)May include surrounding context.

python
def rp(url, payload, timeout=30):
    for attempt in range(3):
        try:
            resp = requests.post(url, json=payload, timeout=timeout)
            return resp.json()
        except Exception as e:
            if attempt < 2:

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The comment above the analysis section says the script only prints and that results need manual confirmation before being written. Yet L150-L174 provide write_result and batch_write helpers that directly insert into the result table, and nothing in those functions enforces any confirmation gate; this contradicts the stated intent of mandatory manual confirmation before writes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The write_result function performs an INSERT into a remote result table via API_INSERT, which is a persistent data-modifying operation. Although comments mention writing results, there is no clear user-facing warning at execution time that using the script can commit records to the backend database.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.