Back to skill

Security audit

medical-triage-booking

Security checks for vulnerabilities and agentic risk

Overview

This medical triage skill mostly matches its stated purpose, but its route-planning flow handles sensitive location data too loosely and includes insecure Baidu Maps behavior that should be reviewed before use.

Install only after reviewing the route-planning behavior. The triage and matching scripts are local aids and are not a medical diagnosis, but directions may reveal sensitive location and hospital-intent data to Baidu or an unspecified IP-geolocation provider. Prefer requiring the user to enter an origin, asking consent before any location lookup, changing generated map links to HTTPS, removing or rotating the hard-coded Baidu key, and documenting that the skill is Chinese/Beijing-focused.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/baidu_route_link.py:75
Finding
Precise Location Data Exposed Through a Plaintext HTTP Route URL<![CDATA[ ## Vulnerability Details **File Location**: `scripts/baidu_route_link.py`, lines 75–101 **Vulnerability Type**: Sensitive information transmitted over an insecure channel **Risk Level**: High ### Vulnerable Code ```python def build_baidu_link( self, origin_lat: float, origin_lng: float, dest_lat: float, dest_lng: float, origin_name: Optional[str] = None, dest_name: Optional[str] = None, mode: str = "driving", region: Optional[str] = None, coord_type: str = "gcj02", ) -> str: if origin_name: origin = f"name:{origin_name}|latlng:{origin_lat},{origin_lng}" else: origin = f"{origin_lat},{origin_lng}" if dest_name: destination = f"name:{dest_name}|latlng:{dest_lat},{dest_lng}" else: destination = f"{dest_lat},{dest_lng}" params: Dict[str, str] = { "origin": origin, "destination": destination, "mode": mode, "coord_type": coord_type, "output": "html", "src": self.src, } if region: params["region"] = region return "http://api.map.baidu.com/direction?" + urlencode(params) ``` ### Technical Analysis The generated route URL uses plaintext HTTP while embedding exact origin and destination coordinates. Optional human-readable origin and destination names are also included in the query string. Although the preceding route-calculation API call uses HTTPS, the link returned to the user does not. When the link is opened, its query string may be visible to network intermediaries such as public Wi-Fi operators, proxies, gateways, or other on-path observers. An active intermediary could also modify the response or redirect the user to a malicious destination. URLs may additionally be retained in browser history, proxy logs, analytics systems, and referrer data. In the context of a medical triage Skill, the destination may reveal an intended hospital or medical specialty, making the exposed route data more ...[truncated 1201 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace the plaintext URL with an HTTPS endpoint: ```python return "https://api.map.baidu.com/direction?" + urlencode(params) ``` 2. Verify that the selected Baidu endpoint officially supports HTTPS and fails closed rather than falling back to HTTP. 3. Avoid including human-readable origin names unless they are necessary. 4. Consider reducing location precision where exact coordinates are not required. 5. Inform the user that route planning sends coordinates to Baidu and obtain consent before transmission. 6. Do not log generated route URLs because they contain sensitive query parameters. 7. Where supported, use short-lived opaque route identifiers rather than placing precise coordinates directly in a reusable URL. 8. Add an automated test that rejects generated links whose scheme is not HTTPS. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/baidu_route_link.py:142
Finding
Hard-Coded Baidu Maps API Credential in Distributed Source Code<![CDATA[ ## Vulnerability Details **File Location**: `scripts/baidu_route_link.py`, line 142 **Vulnerability Type**: Hard-coded third-party API credential **Risk Level**: Medium ### Vulnerable Code ```python ak = os.getenv("BAIDU_MAP_AK", "wK1w1xlWg2Mg6SNLYyLMPl4NuYl9JIf8") ``` ### Technical Analysis The route script uses an embedded Baidu Maps API key whenever `BAIDU_MAP_AK` is absent. Because the key is stored directly in source code, every recipient of the Skill package can extract and reuse it independently of the intended application. The fallback also makes the subsequent missing-key check ineffective under normal conditions: ```python if not ak: print(json.dumps({"error": "Missing environment variable BAIDU_MAP_AK"}, ensure_ascii=False)) return 2 ``` The hard-coded nonempty value means the script silently uses the exposed credential instead of requiring secure configuration. Even if the key is limited to public mapping operations, distributing it prevents reliable attribution and permits unauthorized quota use. ### Attack Path 1. An attacker downloads or otherwise obtains the Skill package. 2. The attacker reads `scripts/baidu_route_link.py`. 3. The attacker extracts the hard-coded API key. 4. The attacker submits requests directly to compatible Baidu Maps API endpoints using that key. 5. Requests consume the credential owner’s quota and may trigger rate limits, account restrictions, or provider charges. 6. If the provider key lacks adequate endpoint, IP, or domain restrictions, abuse may continue until the key is revoked. ### Impact Assessment The exposed key may allow unauthorized use of Baidu APIs enabled for the associated account. Potential consequences include: - Exhaustion of API quotas. - Denial of route service to legitimate users through rate limiting. - Unexpected provider charges, depending on the account plan. - Loss of request attribution and auditability. - Provider suspension or revocation of the credential. The find ...[truncated 224 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Immediately revoke or rotate the exposed API key. 2. Remove the fallback value and require explicit secure configuration: ```python ak = os.getenv("BAIDU_MAP_AK") if not ak: print(json.dumps( {"error": "Missing environment variable BAIDU_MAP_AK"}, ensure_ascii=False, )) return 2 ``` 3. Store the replacement key in an environment variable or an approved secret-management system. 4. Never commit replacement credentials to source control, examples, fixtures, or documentation. 5. Apply provider-side restrictions, including permitted APIs, source IP addresses, domains, applications, and usage quotas where supported. 6. Monitor the provider account for suspicious requests made with the exposed key. 7. Add secret scanning to the development and release process. 8. Ensure logs and error messages never print the API key or complete authenticated request URL. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:118
Finding
User IP Geolocation Is Requested Without an Explicit Consent or Least-Privilege Boundary<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 118–120 **Vulnerability Type**: Unnecessary access to user network-location information **Risk Level**: Medium ### Vulnerable Instruction The relevant workflow instruction states, translated into English: ```text First determine the user's location through the user's IP address. If the IP-based determination fails, prompt the user to provide a location. ``` ### Technical Analysis The route-planning workflow directs the Agent to determine the user’s location from their IP address before asking the user to provide an origin. The Skill does not identify an authorized IP-geolocation mechanism, require informed consent, explain which third party would process the address, or establish retention and precision limits. Access to a user’s IP address is not necessary for the declared route-planning function because the user can directly provide a starting address, landmark, district, or coordinates. The instruction therefore exceeds the minimum data access needed to produce a route. No packaged script implementing IP discovery or IP geolocation was found. Consequently, the risk arises from the Agent instruction and the unspecified tools or services it may cause an execution environment to invoke, rather than from confirmed local IP-collection code. ### Attack Path 1. A user asks for directions to a selected hospital. 2. The Agent loads the route-planning workflow. 3. Following the instruction, the Agent attempts to obtain the user’s IP address from the hosting environment or an available tool. 4. The Agent may submit the IP address to an unspecified geolocation provider. 5. The provider or execution environment derives and potentially records the user’s approximate location. 6. The location is used without the user first choosing whether to provide it or consenting to IP-based processing. The exact exploitation scope depends on what network metadata and geolocation tools are exposed by the ...[truncated 611 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove IP geolocation as the default mechanism. 2. Ask the user to provide a starting address, landmark, district, or coordinates before attempting any automatic location lookup. 3. If IP geolocation remains available, make it strictly optional and obtain explicit consent first. 4. Clearly identify the geolocation provider and explain what data is transmitted. 5. Define retention, logging, sharing, and location-precision limits. 6. Do not attempt to access IP metadata unless the runtime explicitly exposes it for this purpose and the user has consented. 7. Prefer coarse location data when it is sufficient for route suggestions. 8. Provide a route-planning option that does not require automatic location collection. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (24)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The documented behavior claims broad medical-triage functionality but the analyzed implementation apparently performs only a narrow routing-related function while making undisclosed external API calls. In a medical context, hidden divergence plus third-party transmission is more dangerous because users may disclose sensitive health data under the assumption of local triage assistance.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The documented behavior claims broad medical-triage functionality but the analyzed implementation apparently performs only a narrow routing-related function while making undisclosed external API calls. In a medical context, hidden divergence plus third-party transmission is more dangerous because users may disclose sensitive health data under the assumption of local triage assistance.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The documented behavior claims broad medical-triage functionality but the analyzed implementation apparently performs only a narrow routing-related function while making undisclosed external API calls. In a medical context, hidden divergence plus third-party transmission is more dangerous because users may disclose sensitive health data under the assumption of local triage assistance.

Hidden Instructions

High
Category
Prompt Injection
Content
"hospital_name","hospital_intro","department_name","department_intro","doctor_name","doctor_department","doctor_intro","doctor_schedule"
"中日友好医院","","呼吸与危重症医学科","","王辰","呼吸与危重症医学科","",""
"中日友好医院","","中医妇科","","许润三","中医妇科","",""
"中日友好医院","","呼吸与危重症医学科","","曹彬","呼吸与危重症医学科","",""
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
90% confidence
Finding
The skill declares executable scripts, file access, environment-variable dependence, and external network-related behavior, but does not declare any tool scope or permissions. This weakens sandboxing and review controls, making it harder to constrain what the skill can access if executed in a broader-capability runtime.

Intent-Code Divergence

Medium
Confidence
92% confidence
Finding
技能描述声称提供“基于百度地图的到院路线规划链接”,且内置资源列出百度路线与地理编码脚本。然而后续操作说明要求“用 amap-jsapi-skill 技能生成推荐路线”,这不是信息缺失,而是对实际实现的直接矛盾描述。

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The skill metadata and description are entirely framed for Chinese-speaking end users and specific Beijing services, but the file does not state that the skill is region/language-specific or provide a user language choice. Under the policy, forcing a specific language or locale without opt-in is a natural-language policy concern.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
Manifest 描述与资源清单将路线规划定义为“基于百度地图”的能力,并列出 baidu_route_link.py 与 baidu_geocode.py 作为实现资源。但工作流程第 7.3 步明确要求使用 “amap-jsapi-skill” 生成路线并给出链接,这与技能宣称的地图平台和实现方式不一致。

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill instructs using the user's IP to infer location for route planning without any notice, consent, or less-invasive default. Inferring location from IP constitutes collection of sensitive contextual data, and in a medical skill it can reveal where a user is seeking care and create unnecessary privacy exposure.

Ssd 3

Medium
Confidence
94% confidence
Finding
The instruction to infer user location from IP lacks a necessity justification and consent handling, resulting in unnecessary processing of personal data. In the medical context, combining approximate location with healthcare-seeking activity increases privacy risk and could expose sensitive behavioral information if logged or shared.

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
This CSV row embeds website text that explicitly presents an English mode alongside other site content, but the extracted dataset itself is overwhelmingly Chinese and provides no indication of user language choice or localization handling. For a skill consuming this file, the natural-language content reflects a fixed locale presentation rather than an explicit opt-in language policy.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This row contains mixed-language site navigation text including "ENGLISH/英文" and fixed Chinese content, but the dataset itself does not offer any user-selectable locale mechanism. That creates a locale-policy concern if a skill relies on this file as authoritative output content and serves it without user choice.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The row includes explicit references to audience-specific language editions such as "大众版 专业版 English," but the file as stored is a fixed-language extract with no accompanying opt-in or selection instructions. In an AI skill context, this can result in users being served a predetermined locale without consent.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The entire skill guidance is written only in Chinese and does not indicate that users may choose another language or locale. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly documented and justified.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The script transmits user-supplied address and city values to Baidu's external geocoding API, which is a real privacy issue in a medical-triage skill because destination searches may reveal sensitive health-related intent such as a specific hospital or specialty clinic. There is no in-code consent, minimization, or disclosure mechanism, so potentially sensitive user data is sent to a third party without an explicit trust boundary being surfaced.

External Transmission

Medium
Category
Data Exfiltration
Content
def geocode(address: str, city: str, ak: str, timeout: int) -> Dict[str, Any]:
    url = "https://api.map.baidu.com/geocoding/v3/"
    params = {
        "address": address,
        "city": city,
Confidence
88% confidence
Finding
This code makes an outbound request to an external service, carrying user-controlled location data in the query string. In the context of medical triage and hospital booking, even seemingly simple address or hospital-name lookups can expose sensitive health-related information to a third party, so the external transmission is security-relevant rather than a harmless implementation detail.

External Transmission

Medium
Category
Data Exfiltration
Content
alternatives: int = 1,
    ) -> Dict[str, Any]:
        endpoint_map = {
            "driving": "https://api.map.baidu.com/directionlite/v1/driving",
            "walking": "https://api.map.baidu.com/directionlite/v1/walking",
            "riding": "https://api.map.baidu.com/directionlite/v1/riding",
        }
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
alternatives: int = 1,
    ) -> Dict[str, Any]:
        endpoint_map = {
            "driving": "https://api.map.baidu.com/directionlite/v1/driving",
            "walking": "https://api.map.baidu.com/directionlite/v1/walking",
            "riding": "https://api.map.baidu.com/directionlite/v1/riding",
        }
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
alternatives: int = 1,
    ) -> Dict[str, Any]:
        endpoint_map = {
            "driving": "https://api.map.baidu.com/directionlite/v1/driving",
            "walking": "https://api.map.baidu.com/directionlite/v1/walking",
            "riding": "https://api.map.baidu.com/directionlite/v1/riding",
        }
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script transmits precise origin/destination coordinates and the API key to Baidu's external routing service without any visible consent, minimization, or disclosure mechanism. In a medical-triage context, location data can be sensitive because it may reveal care-seeking behavior and proximity to specific hospitals, increasing privacy risk even though the transmission is functionally necessary.

External Transmission

Medium
Category
Data Exfiltration
Content
if region:
            params["region"] = region

        return "http://api.map.baidu.com/direction?" + urlencode(params)


def format_distance(distance_m: Optional[int]) -> str:
Confidence
99% confidence
Finding
The generated Baidu map link uses plain HTTP, which exposes precise origin/destination coordinates, place names, and routing context to interception or modification by network attackers. In this medical booking skill, such leakage can reveal highly sensitive healthcare-related travel patterns and enable tampering with the destination link shown to users.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
This code emits a natural-language note in Chinese ("默认输出提前半天内的3次提醒:12小时、6小时、2小时。") while the rest of the CLI interface and error text are in English. That creates a locale-policy concern because the skill forces a specific language for part of the user-visible output without any opt-in or documented locale constraint.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
The argument parser defaults `--city` to `北京`, which imposes a specific locale/language assumption on users without opt-in. This can violate language/locale policy expectations unless the tool is explicitly documented as China-specific or offers a neutral default.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The helper functions return Chinese-only strings such as `未知`, `小时`, and `分钟`, which fixes the output language regardless of user preference. This is a natural-language locale policy concern because the skill does not offer opt-in or configuration for language selection.

Static analysis

No suspicious patterns detected.