Back to skill

Security audit

ai-medical-care-manager

Security checks for vulnerabilities and agentic risk

Overview

This outpatient assistant is mostly coherent, but it needs review because it can share sensitive healthcare-route location data with AMap without explicit opt-in and relies on polluted provider data for recommendations.

Before installing, require the assistant to ask before using IP geolocation or sending addresses/coordinates to AMap, avoid using a home address when a coarse origin is enough, verify any recommended doctor or department through official hospital channels, and keep the AMap key in environment configuration rather than a local plaintext file. Do not rely on this skill for diagnosis or emergency decisions.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (4)

other

Warning
Location
scripts/amap_ip_locate.js:31
Finding
Location Data Is Transmitted to a Third Party Without Explicit Consent<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:155-160`; `references/flow_playbook.md:16-18`; `scripts/amap_ip_locate.js:31-39`; `scripts/amap_geocode.js:19-34` **Vulnerability Type**: Sensitive Location Data Disclosure **Risk Level**: Medium ### Evidence ```javascript async function locateByIp(ip) { const key = process.env.AMAP_WEBSERVICE_KEY || process.env.AMAP_KEY; if (!key) return { error: 'Missing AMAP_WEBSERVICE_KEY (or AMAP_KEY)' }; if (!ip) { return { error: 'Missing --ip. Only use IP locate when you truly have the user IP; otherwise ask user for current location.' }; } try { const resp = await axios.get('https://restapi.amap.com/v3/ip', { params: { key, ip, output: 'JSON' }, timeout: 15000 }); ``` ```javascript const resp = await axios.get('https://restapi.amap.com/v3/geocode/geo', { params: { key, address, city: city || undefined, output: 'JSON' }, timeout: 15000 }); ``` The documented workflow instructs the agent to attempt IP-based positioning first when a real user IP is available, then geocode the user's origin and hospital destination. ### Technical Analysis The routing workflow sends a user's IP address or free-form location description to Amap's external API. Neither the scripts nor the surrounding workflow require an explicit consent decision before this transmission. An IP address, exact address, and derived coordinates are sensitive location data. Their sensitivity is increased in this Skill because the destination is commonly a hospital or medical department. A third party could therefore associate a location with a healthcare-related journey. TLS protects the request in transit but does not eliminate disclosure to the API operator. The API key is also placed in the HTTPS query parameters by Axios, as required by this API integration. ### Attack Path 1. A user asks the Skill to plan a route to a hospital. 2. The runtime or agent context provides the user's IP ...[truncated 961 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require explicit opt-in before sending an IP address, address, or coordinates to Amap. 2. Clearly identify the third-party recipient and enumerate the data that will be transmitted. 3. Prefer a user-supplied coarse origin, such as a transit station or neighborhood, instead of automatically using the user's IP. 4. Do not echo the original IP address in script output unless it is strictly required. 5. Minimize precision before transmission when exact routing is unnecessary. 6. Add a non-network fallback that gives manual instructions for opening Amap. 7. Document expected third-party retention and privacy behavior. 8. Ensure medical details, symptoms, appointment data, and patient identifiers are never included in geocoding requests. ]]>

other

Warning
Location
scripts/vendor/amap_index.js:271
Finding
Generated Amap URL Exposes Precise Route Details<![CDATA[ ## Vulnerability Details **File Location**: `scripts/vendor/amap_index.js:271-275`; `scripts/amap_route_link.js:112-131` **Vulnerability Type**: Sensitive Data in URL **Risk Level**: Medium ### Evidence ```javascript function generateMapLink(mapTaskData) { const baseUrl = 'https://a.amap.com/jsapi_demo_show/static/openclaw/travel_plan.html'; const dataStr = encodeURIComponent(JSON.stringify(mapTaskData)); return `${baseUrl}?data=${dataStr}`; } ``` ```javascript const mapLink = generateMapLink([ toMapTask(mode, originLng, originLat, destLng, destLat, `${originName} → ${destName}`, city) ]); const output = { mode, origin_name: originName, dest_name: destName, origin, destination, ...summary, distance_text: formatDistance(summary.distance_m), duration_text: formatDuration(summary.duration_s), amap_link: mapLink }; ``` ### Technical Analysis The application serializes route metadata as JSON, URL-encodes it, and places it directly in the `data` query parameter. URL encoding is reversible and provides no confidentiality protection. The embedded data includes: - Exact origin coordinates. - Exact destination coordinates. - User-provided origin and destination labels. - Transit city information when applicable. - The route mode. URLs commonly appear in browser history, copied messages, application telemetry, proxy logs, screenshots, server access logs, and referrer data. In this application, the destination label may identify a hospital and thereby expose health-related activity. ### Attack Path 1. The user provides an origin and requests directions to a hospital. 2. The route script obtains exact origin and destination coordinates. 3. `generateMapLink` serializes both coordinates and labels into a URL query parameter. 4. The generated URL is returned in the agent response. 5. The user opens, shares, copies, or captures the URL. 6. Any party with access to the URL can decode the `data` parameter and recover the route endpoin ...[truncated 582 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not place precise route coordinates or user-provided labels in URL query parameters. 2. If server-side infrastructure is available, store route details temporarily and place only an opaque, short-lived, single-purpose token in the URL. 3. If server-side storage is unavailable, open a generic map page and require the user to enter the origin locally. 4. Reduce coordinate precision when an approximate origin is sufficient. 5. Replace user-specific labels with generic labels such as `Origin` and `Destination`. 6. Warn users that generated links may reveal route endpoints before displaying or sharing them. 7. Apply a short expiration period and access controls to any server-side route representation. 8. Configure an appropriate referrer policy on any controlled web page that handles route information. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/vendor/amap_index.js:7
Finding
Amap API Key Can Be Persisted in a Plaintext Configuration File<![CDATA[ ## Vulnerability Details **File Location**: `scripts/vendor/amap_index.js:7-30`; `scripts/vendor/amap_index.js:34-46` **Vulnerability Type**: Plaintext Secret Storage **Risk Level**: Low ### Evidence ```javascript const CONFIG_FILE = path.join(__dirname, 'config.json'); function saveConfig(config) { try { fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2), 'utf8'); return true; } catch (error) { return false; } } ``` ```javascript function getWebServiceKey() { const config = readConfig(); return config.webServiceKey || null; } function setWebServiceKey(key) { const config = readConfig(); config.webServiceKey = key; return saveConfig(config); } ``` ### Technical Analysis The exported `setWebServiceKey` function stores the Amap Web Service API key in `scripts/vendor/config.json` as unencrypted JSON. The write operation does not specify restrictive file permissions and therefore depends on the process umask and surrounding filesystem configuration. The currently documented workflow primarily uses environment variables and does not directly invoke this setter. Nevertheless, the plaintext persistence capability is included and exported for other callers, making accidental use possible. Plaintext keys in a project directory are susceptible to repository commits, backups, package archives, support bundles, and access by other local users or processes where filesystem permissions permit. ### Attack Path 1. A caller imports `scripts/vendor/amap_index.js`. 2. The caller invokes `setWebServiceKey` with a valid Amap key. 3. The function writes the key to `scripts/vendor/config.json`. 4. The file is copied into a backup, committed to source control, packaged, or read by another local process. 5. The exposed key is reused to consume the owner's API quota or make requests attributed to the owner's Amap account. This path requires a caller to invoke the exported setter; no evidence showed that the normal routing workf ...[truncated 501 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove `saveConfig`, `setWebServiceKey`, and plaintext configuration fallback if environment-variable configuration is sufficient. 2. Use an operating-system secret manager or platform-provided credential store if persistence is required. 3. Never store the key under the project or Skill directory. 4. If a file-based fallback is unavoidable, create it with owner-only permissions such as `0600`. 5. Add `scripts/vendor/config.json` to ignore and packaging-exclusion rules. 6. Add automated secret scanning to source-control and release workflows. 7. Restrict the Amap key by permitted services, quota, and provider-supported source controls. 8. Rotate any key that may already have been written to or distributed with such a configuration file. ]]>

T08 · Insecure Dependencies

Note
Location
package.json:6
Finding
Dependency Installation Is Not Reproducibly Pinned<![CDATA[ ## Vulnerability Details **File Location**: `package.json:6-8`; `SKILL.md:4` **Vulnerability Type**: Non-Reproducible Third-Party Dependency Resolution **Risk Level**: Low ### Evidence ```json "dependencies": { "axios": "^1.13.6" } ``` The Skill metadata also declares installation of the package by name without a lockfile or integrity value: ```json {"kind":"node","package":"axios","bins":[]} ``` ### Technical Analysis The caret version range allows package managers to resolve later compatible releases rather than the exact version reviewed during this audit. The project does not include a lockfile containing a resolved version and integrity hash. No evidence of typosquatting, dependency confusion, a malicious package name, or an unsafe package source was found. `axios` is a correctly named mainstream dependency. The risk is instead that future installations may execute dependency code that differs from the reviewed version. Because Axios handles all external API communication in this Skill, an altered or compromised future release would operate in a process that can access Amap credentials and sensitive location parameters. ### Attack Path 1. An operator installs the Skill at a later date. 2. The package manager resolves `^1.13.6` to a newer compatible Axios release. 3. The installed release differs from the dependency version originally reviewed. 4. If that release is compromised or contains a relevant vulnerability, its code runs when the mapping scripts make HTTP requests. 5. The affected dependency could access request parameters, process environment variables available to the Node.js process, or alter network behavior. This is a supply-chain hardening weakness rather than evidence that the currently named dependency is malicious. ### Impact Assessment No immediate privilege acquisition was demonstrated. The potential scope depends on the behavior of a future or compromised dependency release. Within the Node.js process, dependency ...[truncated 257 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin Axios to an exact reviewed version rather than using a caret range. 2. Generate and commit a lockfile containing resolved versions and integrity hashes. 3. Use deterministic installation commands, such as a clean install based on the lockfile. 4. Configure the installer to use an explicitly trusted registry. 5. Run dependency vulnerability and provenance checks in the release pipeline. 6. Review and update pinned dependencies through a controlled process. 7. Consider limiting environment exposure so mapping subprocesses receive only the Amap credential they require. ]]>
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 (36)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description presents a broad end-to-end outpatient medical assistant, with many healthcare workflow functions and AMap route planning as one component. The supplied code does not implement any of those medical workflow capabilities. It only calls AMap's geocoding endpoint to convert an address into coordinates and related address metadata. While geocoding could be a supporting piece of route planning, this script does not compute routes, provide navigation, or interact with hospitals, doctors, registration systems, reminders, or medical explanations. Therefore the actual behavior is materially narrower and different from the declared purpose, so this is a clear mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
声明描述的是一个完整的门诊就医助手,核心能力覆盖医疗分诊、推荐、挂号与就诊前后支持,并提到基于高德地图的路线规划。实际代码却只是一个独立的IP定位脚本,功能范围非常窄:通过环境变量中的高德Key调用Amap IP定位接口,根据返回矩形计算中心点后输出定位结果。它既不涉及医疗流程能力,也不进行医院/医生推荐,更不执行路线规划本身。虽然IP定位可能可作为路线规划的辅助实现细节,但当前代码片段的主要行为与声明的主要目的明显不一致,且额外体现了对用户IP和外部定位API的使用,这在描述中并未明确说明。因此应判定为描述与代码行为不匹配。

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
声明描述的是一个覆盖门诊就医全流程的综合医疗服务技能,其中路线规划只是最后一环。实际代码却只实现了基于高德地图的路线查询与链接生成:读取命令行参数,调用 walking/driving/riding/transit 路线接口,格式化距离和时长,并输出结果 JSON。代码中没有任何医疗相关逻辑,例如症状分析、科室分诊、医院或医生推荐、挂号处理、就医提醒或诊后解释。因此描述与代码实际行为存在明显不匹配;虽然“到院路线规划”这一子能力与声明部分一致,但不足以支撑其宣称的主要用途。

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
声明描述的是一个覆盖门诊就医全流程的综合技能,包含分诊、科室判断、医院/医生推荐、挂号引导、就医准备、提醒、诊后解释和地图路线规划等多项能力。而给定代码实际只做了一件事:从命令行接收预约时间,解析多种日期格式,计算3个预设提醒时点(T-12h、T-6h、T-2h),并输出JSON结果。虽然“提醒”属于声明中的一个子能力,但当前代码片段的主要功能明显比声明范围窄得多,且没有实现声明中的大多数核心能力。因此描述与实际行为存在明显不匹配。

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
声明描述的是一个覆盖门诊全流程的综合技能,而实际提供的代码块功能非常单一,只实现了“就医准备卡”生成。代码没有进行症状分析分流,也没有任何医院或医生推荐逻辑;没有挂号、提醒、诊后解释或地图路线规划相关代码;也未使用外部服务或地图 API。虽然“生成就医准备卡”属于声明中的一部分,但就该代码块所体现的实际能力而言,与声明的整体功能范围存在明显落差,因此应判定为描述与行为不匹配。

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
声明描述的是一个覆盖门诊就医全流程的C端助手,核心能力应包括症状分析、科室决策、医院/医生推荐、挂号后续服务和地图路线规划。而实际代码只做非常有限的结构化信息抽取:读取CSV中的医院/科室/医生候选项,在给定文本中做子串匹配,并用正则提取日期时间,最后输出解析结果、缺失项和简单置信度。这与声明的主要目的存在明显偏差,属于 materially different primary purpose。代码既没有医学分诊/推荐逻辑,也没有地图、提醒、挂号流程或诊后解释等能力。

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
声明描述的是一个覆盖门诊就医全流程的C端技能,但提供的代码块只覆盖其中前半部分:症状文本关键词匹配、科室候选推断、急症关键词识别,以及基于CSV医院/医生资料的Top 3推荐。这与“先做症状分流和挂号科室判断,再推荐医院/医生 Top 3”是吻合的;但声明中后续承诺的挂号引导、就医准备、提醒、诊后解释、以及高德地图路线规划,在代码中完全没有体现,也没有任何网络/API调用或地图处理逻辑。因此描述显著高于代码实际能力,属于能力描述不准确的 mismatch。未发现额外的敏感或越权行为;问题主要是声明范围远大于实际实现。

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
声明将技能描述为完整的门诊就医助手,核心能力应围绕医疗分诊、科室推荐、医院/医生推荐及就医流程服务展开,仅附带高德路线规划。实际代码却几乎完全聚焦于高德地图服务调用:搜索 POI、规划多种交通路线、生成地图链接,以及旅游兴趣点行程规划。代码中没有任何医疗知识处理、症状分析、医院/医生排序、挂号流程、提醒或诊后解释逻辑。其主要用途与声明明显不同;虽然“基于高德地图的到院路线规划”这一小部分与声明部分一致,但不足以覆盖声明的主体功能,因此属于明显描述与行为不匹配。

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.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The file contains a tourism itinerary planner that is unrelated to the stated medical-care-manager purpose. In a healthcare skill, hidden or mismatched functionality increases supply-chain and trust risk because it may trigger unexpected data flows, confuse downstream agents, or mask unauthorized use of location and query data under a different business purpose.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The README states that route planning will first attempt coarse IP-based geolocation but does not disclose the privacy implications, consent expectations, retention limits, or fallback behavior in a user-facing way. In a medical-care workflow, even coarse location combined with hospital-selection context can reveal sensitive health-related inferences, making undocumented location collection more risky than in a generic mapping feature.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill declares executable scripts, environment-variable use, and file reads, but it does not declare an explicit tool scope or permissions boundary. In practice this can cause the hosting agent to grant broader-than-expected capabilities or make reviewers unaware that the skill needs local file access and secrets, increasing the chance of unintended data exposure or unsafe execution.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The manifest description is entirely in Chinese and presents the skill as serving Chinese consumer outpatient workflows, with no indication that users may choose another language. This creates a language/locale policy concern because the skill appears to impose a specific language experience by default rather than offering opt-in or alternatives.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The main skill instructions, user prompts, and output guidance are all specified in Chinese, and there is no instruction to adapt to the user's preferred language. Because the policy applies to natural-language content in any file type, this is a language-forcing behavior unless the locale restriction is explicitly justified.

Description-Behavior Mismatch

Medium
Confidence
99% confidence
Finding
Role labels like '专家出诊', '知名专家', '副主任医师', '住院', and similar service labels are being stored as doctor names, which breaks identity integrity for provider recommendation. In a medical recommendation context, this can lead users to believe they are being referred to specific clinicians when the system is actually surfacing generic labels or placeholders.

Description-Behavior Mismatch

Medium
Confidence
98% confidence
Finding
These rows contain non-provider or non-clinical entities represented as doctor/department records, which directly conflicts with the skill's claim of recommending real doctors and hospitals. In a healthcare workflow, such entity confusion can produce unsafe recommendations, failed bookings, and loss of user trust at moments where users may rely on the output for time-sensitive care decisions.

Description-Behavior Mismatch

Medium
Confidence
98% confidence
Finding
The dataset is clearly polluted with whole-site navigation, recruitment, informational chrome, and other scraped page text that is not structured clinical provider data. In a medical triage and doctor-recommendation skill, this can cause the system to rank or present irrelevant entities as hospitals, departments, or doctors, creating unsafe medical guidance and misdirected care.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The playbook instructs the skill to attempt real user IP coarse-location before asking the user for a manual location, but it does not mention obtaining explicit consent or warning the user about the privacy implications. In a medical-care workflow, location data is especially sensitive because it can be linked with health-related activity such as hospital visits, increasing privacy and profiling risks.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
This markdown file presents all user-facing response templates exclusively in Chinese and does not indicate that the user can choose another language. That can violate a language/locale policy when the skill effectively forces a specific language without documented opt-in or justification.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This markdown file presents all user-facing guidance exclusively in Chinese, and there is no indication that the skill is limited to Chinese-speaking users or that users can opt into another language. That creates a natural-language policy concern because it effectively forces a specific language without explicit justification or choice.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script sends a user's IP address to AMap's external geolocation API, which is a third-party disclosure of personal data and location-related metadata. While the code comments and error text acknowledge that IP-based location should only be used when the user IP is truly available, there is no technical enforcement of user notice, consent, or minimization in this file, which is more sensitive in a medical-care workflow because it can reveal where a patient is seeking care.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The script sends precise origin and destination coordinates to external routing functions, which likely invoke a third-party map service, but this file provides no user-facing notice, consent flow, or minimization for highly sensitive location data. In a medical care workflow, route queries can reveal where a patient lives and which clinic or hospital they are visiting, making the privacy risk more sensitive than a generic navigation use case.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The script’s user-facing content, including department mappings, question prompts, notes, and defaults, is entirely in Chinese. Because it does not provide any mechanism for language selection or document a justified locale restriction, it can violate the policy against forcing a specific language without user opt-in.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
This code emits a fixed Chinese instruction in the user-facing output note: '如字段缺失,请让用户手动补充医院、科室、医生或就诊时间。' The file does not indicate that the skill is explicitly China/Chinese-specific or provide any user opt-in for language selection, so it creates a natural-language locale policy concern.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The AMAP API key is written in plaintext to a local config.json file, with no protections, permission checks, or user warning. Stored credentials can be exposed through source checkout, backups, logs, container layers, or overly broad filesystem access, enabling unauthorized API use and possible billing abuse.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/amap_geocode.js:19

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/amap_ip_locate.js:31

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/vendor/amap_index.js:59