Back to skill

Security audit

App Order Prod Key Stats

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed order-analytics helper, but its live database query template handles user inputs unsafely and could expose more business data than intended.

Install only in an environment with tightly scoped read-only database credentials, restricted network access, and trusted users. The SQL should be parameterized and inputs validated before use against production data; add privacy controls for small cohorts and pin dependencies for reproducible installs.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:99
Finding

SQL Injection Through Unsafely Interpolated Query Parameters

Content
View full analysis
= '{start_time}' AND create_time < '{end_time}' {keyword_filter} {order_type_filter} GROUP BY {group_by} ORDER BY payment_amount DESC; """ ``` ### Technical Analysis Python f-string interpolation is not an SQL-escaping or parameterization mechanism. An attacker can place quote characters, SQL operators, comments, subqueries, or `UNION` clauses in any of the following values: - `start_time` - `end_time` - Individual entries derived from `keyword` - `order_type` For example, the business-area filter is assembled as: ```sql AND order_type='' ``` A value such as: ```text ' OR 1=1 -- ``` terminates the string literal, adds an always-true expression, and comments out the remainder of the query. Keyword values are similarly embedded inside two `LIKE` patterns without escaping. The dimension expressions are selected from fixed branches and are therefore allowlisted in the shown template. They are not the source of this vulnerability. ### Attack Path 1. An attacker requests a report and sup ...[truncated 1779 chars]
Remediation
View remediation
= %s AND create_time < %s {keyword_filter} {order_type_filter} GROUP BY {group_by} """ df = pd.read_sql(sql, conn, params=params) ``` 2. Keep `select_dim` and `group_by` restricted to hardcoded allowlisted constants. SQL identifiers generally cannot be supplied through value placeholders. 3. Parse the start and end values with `datetime.strptime` and reject values that do not exactly match an approved date format. 4. Accept business-area values only through the documented mapping table. Reject arbitrary database values. 5. Set maximum keyword lengths and counts to reduce abuse and denial-of-service risk. 6. Give the database account access only to the required table and columns, rather than broad schema-level read access. 7. Configure a server-side statement timeout or execution-time limit. 8. Avoid returning raw database exception messages to end users because they can assist SQL injection development. 9. Add tests containing quotes, comment markers, wildcard characters, and SQL operators to verify that all inputs remain data rather than executable SQL. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:7
Finding

Unpinned Python Dependencies Create a Supply-Chain Integrity Risk

Content
View full analysis
Remediation
View remediation
pandas== tabulate== ``` 2. Maintain a lock file that captures all transitive dependencies. 3. Require cryptographic hashes during installation, such as a hash-locked requirements file installed with `pip --require-hashes`. 4. Retrieve packages only from an approved repository or internal mirror. 5. Scan direct and transitive dependencies for known vulnerabilities before release and continuously thereafter. 6. Review and deliberately update dependency pins rather than resolving new versions automatically at runtime. 7. Build the execution environment ahead of time and deploy an immutable, signed artifact instead of installing dependencies when the skill is invoked. 8. Run the skill with minimal filesystem permissions, restricted outbound network access, and narrowly scoped database credentials to reduce the impact of a compromised package. ]]>
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill performs database queries over order data and returns user-related aggregates, yet it lacks privacy and data-handling guardrails such as audience restrictions, minimum aggregation thresholds, or warnings against sensitive use. Even though it returns counts rather than raw identities, analytics over narrow filters or small groups can still expose sensitive business or user behavior patterns.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger phrases are broad enough to overlap with normal analytics requests, which can cause this skill to activate unexpectedly in situations involving database-backed order analysis. In this skill, unintended invocation is more dangerous because the skill is wired to live database access and can return aggregated business and user-related metrics without a clearly narrow activation boundary.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

SKILL 文档多处声明必须保留“销售占比的 OVER()”、示例输出也包含“销售占比”,版本记录还称 v1.3 已加入 SUM() OVER() 窗口函数。但实际提供的 SQL 模板与 Python 中拼接的 SQL 只查询订单数、未支付数、退款数、支付金额、退款金额、用户数,没有任何销售占比字段或窗口函数,却在输出中声称“销售占比总和 100%”。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

文档末尾总结明确写“支持多关键词 Boolean AND 搜索”,但代码在构造关键词条件时使用 OR.join(conditions),正文示例与说明也写的是“OR 关系,包含任意一个关键词即可匹配”。这是对检索语义的直接矛盾描述。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

标题写明“增强版 v1.3”,manifest version 也是 1.3,但后文更新记录包含“v1.4(2026-03-07)”特性,且当前正文已描述这些特性为现行行为。这会让使用者误判当前技能实际具备的能力与版本状态。

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.