Back to skill

Security audit

员工XXX的相关案件查询

Security checks for vulnerabilities and agentic risk

Overview

The skill is a simple internal case lookup SOP, but it directs broad retrieval of sensitive employee investigation records using only a name and does not document authorization or minimization controls.

Review before installing. This skill should only be used in an environment with enforced HR/legal authorization, row- and field-level access controls, audit logging, result limits, and parameterized queries. Users should not be able to retrieve employee investigation details merely by knowing a name.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:17
Finding

Employee investigation records can be queried without documented authorization controls

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 17-25
Vulnerability Type: Missing authorization and data-minimization controls
Risk Level: High

Relevant skill instructions:

text
## 输入参数
- 人员姓名

## 执行流程
> Claude 请严格按以下步骤依次查询数据表并分析,注意每一步的依赖关系、输入与输出字段。

step_1_1:xx作为被处理人
从表【jd_rcp_case_dispose_insider_new】输入人员姓名【namebdp】获取对应的案件编号,处理结果
step_1_2:xx出现在案件标题、描述、内容、摘要
从表【jd_rcp_case_info】输入人员姓名,筛选 title_search LIKE '%{name}%' OR summary_search LIKE '%{name}%' OR description_search LIKE '%{name}%' OR content_search LIKE '%{name}%' 来获取案件编号
step_2:查询案件的详情
从表【jd_rcp_case_info】中输入案件编号,获取案件详情,返回案件编号、案件名称、案件描述、案件状态、负责人、跟进部门、举报方式、调查结论、处理结果
依赖 step_1.casenum

Technical Analysis

The skill accepts only an employee name before instructing the agent to search internal case tables and disclose case identifiers, descriptions, reporting methods, investigation conclusions, and disciplinary outcomes. It does not require verification of the requester's identity, role, business purpose, case-level access, or relationship to the employee.

These records are likely to contain confidential employee, complaint, and investigation information. The instructions also do not require field-level redaction, result limits, access logging, consent, or approval. Consequently, any user able to invoke the skill may be treated as authorized to retrieve the complete record set.

Attack Path

  1. A user invokes the skill and provides the name of a targeted employee.
  2. The skill searches jd_rcp_case_dispose_insider_new for cases in which that employee was the subject of a disposition.
  3. It searches the title, summary, description, and content fields of jd_rcp_case_info for additional references to the employee.
  4. The resulting case numbers are used to retrieve full case details.
  5. The agent returns confidential descriptions, reporting methods, investigation conclusions, and outcomes without a documented author ...[truncated 677 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require authenticated requester identity and role-based authorization before performing any query.
  2. Enforce authorization in the database or service layer rather than relying solely on agent instructions.
  3. Add case-level and employee-level access checks, including verification of the requester's department, assigned cases, and approved business purpose.
  4. Deny access by default when authorization context is absent or ambiguous.
  5. Return only fields necessary for the authorized purpose. Redact complainant identities, reporting channels, free-form narratives, and other sensitive personal information by default.
  6. Apply result limits and prevent unrestricted enumeration through repeated name searches.
  7. Record the requester, purpose, searched employee, returned case identifiers, and timestamp in tamper-resistant audit logs.
  8. Require additional approval for especially sensitive investigation conclusions and disciplinary results.
  9. Add explicit instructions that the skill must not disclose records merely because a user knows an employee's name.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:21
Finding

User-controlled employee names are shown as direct SQL LIKE-clause interpolation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 21
Vulnerability Type: Potential SQL injection through unsafe query construction
Risk Level: Medium

Relevant skill instruction:

text
step_1_2:xx出现在案件标题、描述、内容、摘要
从表【jd_rcp_case_info】输入人员姓名,筛选 title_search LIKE '%{name}%' OR summary_search LIKE '%{name}%' OR description_search LIKE '%{name}%' OR content_search LIKE '%{name}%' 来获取案件编号

Technical Analysis

The documented query pattern inserts the user-supplied name value directly between SQL wildcard and quote characters. If an implementation translates this template literally into raw SQL, quote characters or SQL operators in the supplied name could escape the intended string literal and alter query semantics.

Even when full SQL injection is prevented elsewhere, unescaped % and _ characters can still change LIKE matching behavior and permit broader record discovery than intended. The repository contains only SKILL.md, so no executable database adapter was available to confirm whether parameterization is applied at runtime. The vulnerability is therefore specifically associated with implementations that follow the documented interpolation pattern literally.

Attack Path

  1. An attacker supplies an employee-name value containing quote characters, SQL syntax, or LIKE wildcard characters.
  2. A vulnerable implementation substitutes that value directly for {name} in each LIKE '%{name}%' expression.
  3. The crafted value changes the predicate rather than being treated exclusively as data.
  4. The modified query may match unrelated cases or, depending on the database driver and query execution policy, execute an injected expression.
  5. The attacker receives case identifiers and uses the next documented step to request sensitive details for the expanded result set.

Impact Assessment

Under a literal raw-SQL implementation, an attacker may be able to bypass name-based filtering an ...[truncated 505 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace string interpolation with prepared statements and bound parameters for every occurrence of the employee name.
  2. Construct the pattern as a parameter value, such as a bound value containing the required surrounding wildcards, rather than concatenating it into SQL.
  3. Escape %, _, and the configured escape character when names must be matched literally, and declare an explicit SQL ESCAPE character.
  4. Validate employee names against the organization's canonical identity directory and prefer an immutable employee identifier over free-form names.
  5. Prohibit the agent from generating or executing arbitrary SQL. Expose a fixed, typed query API with narrowly defined inputs and outputs.
  6. Give the database identity read-only access only to approved views and columns, with row-level security where supported.
  7. Add tests covering quotes, comments, boolean operators, Unicode edge cases, %, and _ to verify that all input remains data and cannot broaden the predicate unexpectedly.
  8. Apply authorization checks independently of parameterization, because injection prevention does not prevent an otherwise unauthorized but syntactically valid search.
Vulnerability Patterns
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is designed to retrieve sensitive case records about named employees, including case descriptions, investigation conclusions, and handling results, but it provides no warning, authorization check, or usage restriction. In this context, missing privacy and access-control guidance materially increases the risk of insider misuse, unauthorized personnel lookups, and exposure of highly sensitive HR/compliance investigation data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The natural-language content of the skill, including its name, description, and execution steps, is entirely in Chinese. There is no indication that the user can choose another language or that the skill is intentionally restricted to a Chinese-speaking or region-specific audience.

Content

No source excerpt is available for this finding.