Back to skill

Security audit

tyxh-lc

Security checks for vulnerabilities and agentic risk

Overview

This skill is a simple patient-record lookup, but it directs the agent to retrieve sensitive patient details from an external service using only a patient ID and no authentication.

Install only if you are authorized to access the patient records exposed by this endpoint and the service owner has confirmed authentication, authorization, logging, and privacy controls outside the skill. Do not use it with real patient data unless it complies with applicable medical and privacy rules.

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

Error
Location
SKILL.md:34
Finding

Unauthenticated External API Enables Unauthorized Patient Information Retrieval

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 2 and 34–47
Vulnerability Type: Unauthenticated access to sensitive patient information
Risk Level: High

Vulnerable Code

yaml
description: 查询患者信息,支持通过患者编号/ID获取患者详情(无需认证)
markdown
## API 接口

- **接口地址**: `https://kjcrmcs.tianyuxh.com:8107/task/agent_test/getPatientInfo`
- **请求方法**: GET
- **参数**: `patient_id` (患者编号)

## 使用方式

### 1. 查询指定患者

当用户提供患者编号时,使用以下命令查询:

```bash
curl -s "https://kjcrmcs.tianyuxh.com:8107/task/agent_test/getPatientInfo?patient_id={患者编号}"

Technical Analysis

The skill explicitly describes the patient-information endpoint as requiring no authentication and instructs the agent to request patient details using only a numeric patient_id. No authentication credential, caller identity verification, consent check, or record-level authorization control is included in the documented request.

This design exposes a potential insecure direct object reference and broken object-level authorization condition. If the endpoint accepts arbitrary identifiers as documented, an unauthenticated caller can submit an identifier belonging to another patient. Predictable or sequential numeric identifiers could also permit systematic record enumeration.

The patient identifier is transmitted in a GET query string. Although HTTPS protects the request in transit, URLs may be retained in application logs, reverse-proxy logs, monitoring platforms, browser or shell history, and other telemetry systems. This unnecessarily increases exposure of health-associated identifiers.

Attack Path

  1. An attacker invokes the skill with a known, obtained, or guessed numeric patient identifier.
  2. The skill extracts that identifier from the request.
  3. The agent executes the documented unauthenticated request: GET /task/agent_test/getPatientInfo?patient_id=<identifier>.
  4. If the server behaves as documented, it returns ...[truncated 1172 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require strong authentication for every patient-information request, using a validated session or short-lived access token.
  2. Enforce server-side object-level authorization. Verify that the authenticated principal is permitted to access the requested patient record; never rely on the skill or client to enforce this boundary.
  3. Apply least privilege through narrowly scoped roles and permissions for patients, clinicians, support personnel, and service accounts.
  4. Avoid placing patient identifiers in URL query strings. Use an appropriately designed authenticated request body where feasible, while recognizing that changing the HTTP method does not replace authorization.
  5. Minimize the response to only the fields required for the user's authorized task and redact sensitive fields by default.
  6. Require explicit user confirmation before transmitting a patient identifier to the external service.
  7. Add rate limiting, enumeration detection, access auditing, and alerts for repeated requests involving different patient identifiers.
  8. Ensure application, proxy, shell, and monitoring logs do not retain patient identifiers or returned health information in plaintext.
  9. Return a uniform authorization error for inaccessible or nonexistent records to reduce identifier-discovery signals.
  10. Perform authorization tests covering unauthenticated requests, cross-patient access, sequential identifier enumeration, expired credentials, and users with insufficient roles.
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 (1)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly enables unauthenticated retrieval of patient details from an external API using only a patient ID, which exposes sensitive medical/PII data without access control or user consent safeguards. In the healthcare context, this is especially dangerous because the trigger patterns and example curl command make it easy to enumerate patient records and leak protected health information at scale.

Content

No source excerpt is available for this finding.