Back to skill

Security audit

LUI 定时任务冲突检测

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed pre-checker, but it includes unsafe integration guidance and a benchmark runner that can execute code outside the package.

Review before installing or publishing broadly. The core checker appears purpose-aligned and does not itself create real tasks, but the benchmark runner should be fixed to call the packaged script only, and the SQL examples should be rewritten to require bound parameters. Disable or relocate local tracking if you do not want local run logs.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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)

T07 · Tool Hijacking and Spoofing

Warning
Location
benchmarks/lui_conflict_50_cases/tools/run_benchmark.py:27
Finding
Benchmark Runner Executes a Hard-Coded External Script## Vulnerability Details **File Location**: `benchmarks/lui_conflict_50_cases/tools/run_benchmark.py:27, 64-70` **Vulnerability Type**: Untrusted external tool execution **Risk Level**: Medium ### Vulnerable Code ```python CHECKER = Path("/Users/wangzhilelelelele/.agents/skills/scheduled-task-conflict-checker/scripts/check_scheduled_task_conflicts.py") ``` ```python completed = subprocess.run( [sys.executable, str(CHECKER), str(TEMP_INPUT), "--format", "json"], check=False, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) ``` ### Technical Analysis The benchmark runner does not execute the checker included in the audited project. Instead, it launches a Python file from a fixed absolute path outside the project directory. Because the external file is not part of the audited artifact, its integrity and behavior cannot be guaranteed. Any user or process able to create or replace the file at that location can cause the benchmark runner to execute arbitrary Python code. The argument-list form of `subprocess.run` prevents shell metacharacter injection, but it does not mitigate execution of an untrusted script. This also undermines benchmark integrity: reported results may come from a stale, modified, or unrelated checker rather than the bundled implementation. ### Attack Path 1. An attacker obtains write access to the hard-coded `.agents/skills` location, or prepares that location before the benchmark is run. 2. The attacker creates or replaces `check_scheduled_task_conflicts.py` with malicious Python code. 3. A user follows the documented validation procedure and runs `run_benchmark.py`. 4. The runner invokes the external file through the current Python interpreter. 5. The malicious code executes with the operating-system privileges and environment of the benchmark user. ### Impact Assessment Successful exploitation permits arbitrary code execution with the benchmark runner's user privileges. Depending on those privileges ...[truncated 417 chars]
Remediation
## Remediation Suggestions Resolve the checker from the project directory rather than an external user-specific location. For example: ```python PROJECT_ROOT = ROOT.parents[1] CHECKER = PROJECT_ROOT / "scripts" / "check_scheduled_task_conflicts.py" ``` Before execution: 1. Resolve both paths using `Path.resolve()`. 2. Verify that the checker is a regular file. 3. Verify that the resolved checker remains beneath the expected project root. 4. Fail closed if validation fails. 5. Optionally verify a trusted file hash in release or CI environments. 6. Remove the user-specific absolute path from the repository. 7. Regenerate benchmark results using the bundled checker. A hardened check could use: ```python project_root = PROJECT_ROOT.resolve() checker = CHECKER.resolve(strict=True) if not checker.is_file() or not checker.is_relative_to(project_root): raise RuntimeError("Checker must be a regular file inside the project") ```

T09 · Insecure Skill Coding Practices

Warning
Location
references/permission-sql.md:60
Finding
Permission SQL Templates Use Direct Identifier Interpolation## Vulnerability Details **File Location**: `references/permission-sql.md:60, 86, 157, 198, 209` **Vulnerability Type**: SQL injection through unsafe template substitution **Risk Level**: Medium ### Vulnerable Code The permission-checking templates repeatedly place `ali_id` directly inside SQL string literals: ```sql FROM your_shopkeeper_bound_shop_table WHERE ali_id = '${ali_id}' ``` ```sql FROM your_isv_paid_status_result_table WHERE ali_id = '${ali_id}' ``` The comprehensive permission query contains the same pattern: ```sql FROM your_shopkeeper_bound_shop_table WHERE ali_id = '${ali_id}' ), isv_paid_status_result AS ( SELECT ali_id, shop_code, channel, code, message, is_paid FROM your_isv_paid_status_result_table WHERE ali_id = '${ali_id}' ) ``` ### Technical Analysis The Skill instructs integrations to use these SQL templates for shop binding, authorization, and paid-status checks. The `${ali_id}` syntax encourages textual substitution into an SQL statement rather than parameter binding. If `ali_id` is attacker-controlled or insufficiently validated, a crafted value containing a quote and SQL syntax can terminate the intended string literal and alter the query. The exact payload and possible operations depend on the database engine, driver settings, and whether stacked statements are permitted. Even when the database account is read-only, query manipulation may expose another user's shop or authorization records. More critically for this Skill, manipulated rows could cause downstream logic to trust a forged authorization or entitlement state. ### Attack Path 1. An integration copies the documented template and implements `${ali_id}` using direct string replacement or formatting. 2. An attacker supplies or influences an `ali_id` containing SQL control characters. 3. The application inserts that value into the SQL text without parameter binding. 4. The database parses the injected syntax as part of the query. 5. Th ...[truncated 765 chars]
Remediation
## Remediation Suggestions Replace textual interpolation with database-driver bind parameters in every template. For example: ```sql WHERE ali_id = :ali_id ``` Use the placeholder syntax required by the actual driver, such as `?`, `%s`, `$1`, or a named parameter, and provide the value through the driver's parameter API. Additional hardening should include: 1. Explicitly state that `${ali_id}` string replacement is prohibited. 2. Parameterize all proposed-shop values rather than constructing `UNION ALL SELECT` clauses from raw input. 3. Validate identifier format and length as defense in depth, without treating validation as a substitute for binding. 4. Run permission queries through a least-privileged, read-only database account. 5. Disable stacked statements where supported. 6. Avoid returning unnecessary shop or account fields. 7. Add tests using quotes, comments, boolean expressions, and statement separators to verify that inputs are always treated as data.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (65)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill advertises conflict detection but also performs local telemetry logging controlled by environment variables and path settings, with directory creation and append writes. Even though the document says sensitive data must not be logged, hidden telemetry and path-controlled writes expand the attack surface and can lead to unintended persistence, data leakage, or log-file abuse if the environment is manipulated.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill advertises conflict detection but also performs local telemetry logging controlled by environment variables and path settings, with directory creation and append writes. Even though the document says sensitive data must not be logged, hidden telemetry and path-controlled writes expand the attack surface and can lead to unintended persistence, data leakage, or log-file abuse if the environment is manipulated.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill advertises conflict detection but also performs local telemetry logging controlled by environment variables and path settings, with directory creation and append writes. Even though the document says sensitive data must not be logged, hidden telemetry and path-controlled writes expand the attack surface and can lead to unintended persistence, data leakage, or log-file abuse if the environment is manipulated.

Hidden Instructions

High
Category
Prompt Injection
Content
case_id,category,title,new_lui_request,initial_task_count,expected_decision,expected_reason_code,expected_prompt_required,fixture_path
case_001,店铺绑定/授权边界,无绑定店铺时阻断创建,每天9点帮我同步库存,0,block,no_bound_shop,true,fixtures/case_001/input.json
case_002,店铺绑定/授权边界,单店未指定范围时默认该店铺,每天9点同步库存,0,proceed,none,false,fixtures/case_002/input.json
case_003,店铺绑定/授权边界,多店未指定范围要求用户选择,每天9点同步库存,0,ask_confirmation,shop_scope_missing,true,fixtures/case_003/input.json
Confidence
60% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill invokes shell commands, reads reference files, accesses environment variables, and writes local tracking logs, but it does not declare any tool scope or allowed-tools boundary. In an agent environment, undeclared capabilities increase the chance of over-privileged execution, unintended file access, and abuse of shell/file operations beyond the stated purpose.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The skill content, including the description, headings, workflow, and user-facing guidance, is written entirely in Chinese and does not offer any language choice or state that the skill is intentionally limited to Chinese-speaking users. This can violate language/locale policy because it implicitly forces a specific language without user opt-in.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The entire markdown document is written in Chinese and does not provide any indication of language choice, opt-in, or a documented region-specific justification. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Vague Triggers

Medium
Confidence
90% confidence
Finding
This JSON fixture includes a natural-language request, "每天9点帮我同步库存", that describes a common user intent without any explicit trigger boundaries, exclusion conditions, or context limits. In a manifest/plain-text style file, such broadly phrased activation examples can overlap with ordinary conversation and make it unclear when the skill should activate versus when it should not.

Natural-Language Policy Violations

Medium
Confidence
89% confidence
Finding
The string on L89 states that the runner '必须' perform cleanup steps in Chinese, which imposes a specific language/locale in natural-language content. The file does not offer any language choice or explain that a Chinese-only instruction is required for a region-specific workflow.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The cleanup_policy string is written entirely as an instruction in Chinese, which imposes a specific language for operational use. The file does not offer any language choice or explain that the skill is region-specific, so this is a natural-language locale policy violation under the stated rule.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The request text "每天9点做高级铺货" describes an action in broad natural language but does not define explicit trigger phrases, boundaries, or exclusion conditions for when this skill should activate. In a JSON/manifest-style fixture, this can create ambiguity about whether similar everyday scheduling requests should invoke the same capability.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The cleanup policy instructs deletion of runtime/task_pool.json before and after execution, which is a data-destructive operation affecting runtime state. The file describes the deletion requirement but does not include any user-facing warning about the loss of task state or its impact on subsequent runs.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The request text says '每天9点给两个店做高级铺货' but does not explicitly identify which two shops should receive the task, while the proposed task is marked as applying to all shops. In a scheduling and permission-boundary skill, this ambiguity can cause the system to target unintended shops, trigger permission errors, or create only a partial task set without sufficiently clear user consent.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The cleanup_policy text states the requirement in Chinese only ('runner 必须... 禁止...'), which imposes a specific language/locale in the skill content without any user opt-in or alternative language option. This matches the policy category for language or locale constraints expressed in natural-language content.

Vague Triggers

Medium
Confidence
86% confidence
Finding
This JSON manifest includes an imperative cleanup instruction in natural language: the runner 'must' clear and delete a runtime file before and after executing the case, but it does not specify the exact execution scope beyond 'this case' or provide exclusion conditions. In a manifest file, such broad operational instructions can be interpreted too generally and risk unintended invocation or application outside the intended test context.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The user-facing natural-language fields in this fixture are entirely in Chinese, including category, title, request text, and cleanup policy, with no indication that language selection is optional or region-specific. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.

Vague Triggers

Medium
Confidence
82% confidence
Finding
This JSON fixture includes the request text "每天9点再同步一次库存", but the file provides no explicit trigger scope, exclusion conditions, or negative examples clarifying when such phrasing should or should not activate the skill. For a manifest-like JSON file, this can create ambiguity about activation boundaries and unintended matches with similar routine scheduling requests.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The natural-language cleanup policy at L111 states the runner '必须' perform actions in Chinese-language instructions, while the file provides no user choice or justification for a Chinese-only locale requirement. Under the policy, forcing a specific language or locale without opt-in is a reportable natural-language policy violation.

Natural-Language Policy Violations

Medium
Confidence
79% confidence
Finding
This JSON fixture includes a natural-language policy statement in Chinese: the cleanup policy is expressed as a mandatory instruction ('runner 必须...'). Under the policy, forcing a specific language or locale without user choice or explicit justification can be a violation, and this file provides no opt-in or region-specific rationale.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
Line L107 states the cleanup policy partly in Chinese ("runner 必须在本 case 执行前清空...") as an unconditional instruction. This imposes a specific language/locale in the skill content without offering a user choice or documenting a justified region-specific constraint.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The cleanup_policy string explicitly states 'runner 必须...' in Chinese, imposing a specific language/locale in natural-language instructions. The file does not offer any user or operator language choice or justify a region-specific constraint, so this matches the language-policy violation criteria.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
This JSON fixture uses user-facing category, title, and request fields entirely in Chinese, indicating a locale-specific interaction model. There is no accompanying indication that the user can opt into another language or that the Chinese-only behavior is a documented, justified regional constraint.

Natural-Language Policy Violations

Medium
Confidence
86% confidence
Finding
This JSON fixture includes an operational instruction in Chinese ("runner 必须在本 case 执行前清空...") with no indication that language selection is optional or that the file is intentionally limited to a Chinese-only workflow. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Natural-Language Policy Violations

Medium
Confidence
89% confidence
Finding
This JSON contains user-facing categories, titles, messages, and prompts entirely in Chinese, including all `user_prompt` content. There is no accompanying natural-language indication that the skill is China-specific, nor any opt-in or fallback for other languages, which can violate locale-choice policy.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
This file contains natural-language examples exclusively in Chinese in the `new_lui_request` field, indicating the skill behavior and test coverage are constrained to a single language. Under the policy, forcing a specific language without user opt-in or documenting a justified locale scope is a natural-language policy violation.

Static analysis

No suspicious patterns detected.