T05 · Unauthorized Access and Privilege Escalation
- 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: HighVulnerable 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
- An attacker invokes the skill with a known, obtained, or guessed numeric patient identifier.
- The skill extracts that identifier from the request.
- The agent executes the documented unauthenticated request:
GET /task/agent_test/getPatientInfo?patient_id=<identifier>. - If the server behaves as documented, it returns ...[truncated 1172 chars]
- Remediation
View remediation
Remediation Suggestions
- Require strong authentication for every patient-information request, using a validated session or short-lived access token.
- 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.
- Apply least privilege through narrowly scoped roles and permissions for patients, clinicians, support personnel, and service accounts.
- 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.
- Minimize the response to only the fields required for the user's authorized task and redact sensitive fields by default.
- Require explicit user confirmation before transmitting a patient identifier to the external service.
- Add rate limiting, enumeration detection, access auditing, and alerts for repeated requests involving different patient identifiers.
- Ensure application, proxy, shell, and monitoring logs do not retain patient identifiers or returned health information in plaintext.
- Return a uniform authorization error for inaccessible or nonexistent records to reduce identifier-discovery signals.
- Perform authorization tests covering unauthenticated requests, cross-patient access, sequential identifier enumeration, expired credentials, and users with insufficient roles.
