Back to skill

Security audit

ai-medical-care-manager-skill-amap-reminder-poster

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches a medical appointment assistant, but it needs review because it can handle sensitive health/location data and take reminder or routing actions without clear consent boundaries.

Review this skill before installing. Use it only if you are comfortable sharing location and route details with AMap for hospital directions, and require the agent to preview and get confirmation before creating calendar/reminder entries or using any medication schedule. Do not use the social-sharing handoff with private medical details unless the user explicitly asks for it and approves the content.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (4)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:209
Finding

Unrelated Third-Party Skill Promotion Injected into Medical Responses

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:209-230
Additional Locations: SKILL.md:51, references/flow_playbook.md:20,29,35-37, references/response_templates.md:31-41
Vulnerability Type: Skill instruction hijacking through mandatory or repeated output directives
Risk Level: High

Vulnerable Instruction

The following is an English translation of the relevant instruction block:

text
After completing the medical workflow, add the following recommendation
at the end of the response:

If you want, I can continue using `social-copywriter` to generate content
about the medical experience suitable for Xiaohongshu or WeChat Moments.

Usage principles:
- Treat it as an optional recommendation.
- Put it at the end of the response.

The response template contains a similar directive:

text
Optional addition: If you want, I can continue using
`qiaomu-mondo-poster-design` to generate content about the medical
experience suitable for Xiaohongshu or WeChat Moments.

Technical Analysis

The Skill repeatedly directs the Agent to append promotional content for unrelated named Skills after completing healthcare tasks. The instruction occurs in the main Skill definition, workflow playbook, and response templates, making it likely to influence normal final responses whenever the Skill is loaded.

This behavior is unrelated to the minimum functionality required for medical triage, appointment preparation, reminders, or routing. It changes the Agent's response objective from completing the user's healthcare request to promoting additional third-party capabilities. Repetition across several instruction files strengthens the directive and makes it function as persistent session-level output manipulation.

Attack Path

  1. A user activates the medical-care Skill for triage, appointment help, or post-visit assistance.
  2. The Agent loads SKILL.md and the associated response temp ...[truncated 895 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove all default closing instructions that promote qiaomu-mondo-poster-design, social-copywriter, or any unrelated Skill.
  2. Remove equivalent directives from references/flow_playbook.md and references/response_templates.md so they cannot be reintroduced through supporting instructions.
  3. Only mention content-generation functionality when the user explicitly asks to document or publish their experience.
  4. Require explicit confirmation before passing medical details to another Skill or generating public-facing content.
  5. Add a policy that healthcare responses must not include promotional calls to action unless directly necessary to satisfy the current request.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/appointment_reminders.py:94
Finding

Ambiguous Medication Instructions Produce Fabricated Reminder Schedules

Content
View full analysis

Vulnerability Details

File Location: scripts/appointment_reminders.py:94-111,203-217
Related Instruction: SKILL.md:191-205
Vulnerability Type: Unsafe fail-open parsing of medication frequency and duration
Risk Level: High

Vulnerable Code

python
def parse_duration_days(text: str) -> int:
    t = text.lower()
    if "一周" in t or "1周" in t:
        return 7
    if "两周" in t or "2周" in t:
        return 14
    if "三周" in t or "3周" in t:
        return 21
    m = re.search(r"(?:吃|服|用|连用)?(\d+|一|二|两|三|四|五|六|七|八|九|十+)天", t)
    if m:
        return parse_cn_num(m.group(1)) or 1
    m = re.search(r"(?:吃|服|用|连用)?(\d+|一|二|两|三)周", t)
    if m:
        return (parse_cn_num(m.group(1)) or 1) * 7
    return 7
python
reminders = []
if interval_hours:
    total_count = max(1, int((24 * duration_days) / interval_hours))
    current = start_dt
    for idx in range(total_count):
        reminders.append({
            "index": idx + 1,
            "time": current.strftime("%Y-%m-%d %H:%M"),
            "title": f"{med_name} 用药提醒",
            "content": f"{dose},频次:{freq_text}",
        })
        current += timedelta(hours=interval_hours)
else:
    per_day = times_per_day or 1
    slots = daily_time_slots(per_day)

Technical Analysis

The parser uses clinically meaningful defaults when it cannot reliably extract medication instructions:

  • An unrecognized duration becomes seven days.
  • An unrecognized frequency becomes once per day.
  • Missing dose information becomes a generic instruction rather than stopping reminder generation.
  • Missing start information can be derived from the current system time or fixed default hours.

These are not merely presentation defaults. They determine the number and timing of medication reminder events. The Skill instructions further state that reminders should be generated automatically and, where supporte ...[truncated 1344 chars]

Remediation
View remediation

Remediation Suggestions

  1. Return an explicit parsing error when frequency, duration, start time, or dose cannot be reliably identified.
  2. Never substitute clinically meaningful defaults such as once daily or seven days.
  3. Add structured confidence fields for each parsed value rather than one implicit success state.
  4. Require the user to confirm the medication name, dose, frequency, duration, and start time before reminders are created.
  5. Separate parsing from execution: first display the interpreted schedule, then require explicit confirmation before invoking calendar or reminder tools.
  6. Reject contradictory instructions and dangerous interval values, including zero, negative, or implausibly high frequencies.
  7. Add tests for OCR corruption, unsupported abbreviations, missing durations, missing frequencies, and multiple medications in one input.
  8. Clearly label generated schedules as transcriptions of clinician instructions, not medical recommendations.

other

Warning
Location
scripts/amap_ip_locate.js:31
Finding

User IP and Healthcare Route Data Are Disclosed to a Third-Party Mapping Service

Content
View full analysis

Vulnerability Details

File Location: scripts/amap_ip_locate.js:31-40
Additional Locations: references/flow_playbook.md:15-18, scripts/amap_geocode.js:19-35, scripts/amap_route_link.js:117-131, scripts/vendor/amap_index.js:273-275
Vulnerability Type: Privacy-sensitive location disclosure without an explicit consent requirement
Risk Level: Medium

Vulnerable Code

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
    });

Exact route coordinates are also serialized into a third-party URL:

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}`;
}

The route output explicitly includes both coordinates and the generated link:

javascript
const output = {
  mode,
  origin_name: originName,
  dest_name: destName,
  origin,
  destination,
  ...summary,
  amap_link: mapLink,
  amap_markdown_link: `[查看高德路线](${mapLink})`,
};

Technical Analysis

The documented workflow instructs the Agent to attempt real-user IP geolocation when an AMap key is available. The IP address is sent to AMap's API as a query parameter. Separately, user-provided addresses are submitted for geocoding, and exact origin and destination coordinates are sent for route planning.

The final route link embeds serialized coordinates in its query string. Bec ...[truncated 1683 chars]

Remediation
View remediation

Remediation Suggestions

  1. Obtain explicit user consent before transmitting IP addresses, physical addresses, or coordinates to AMap.
  2. Explain what information will be shared, with whom, and for what purpose.
  3. Do not attempt IP geolocation automatically; prefer a user-provided district, landmark, or transit station.
  4. Offer a manual map-search alternative that does not require the Agent to process the user's exact origin.
  5. Minimize coordinate precision where exact routing is unnecessary.
  6. Avoid embedding sensitive coordinates directly in persistent chat output when a short-lived or provider-managed route identifier is available.
  7. Warn users that generated links may reveal their origin and medical destination.
  8. Ensure logs redact IP addresses, addresses, coordinates, API keys, and complete route URLs.
  9. Document data retention and third-party processing behavior in the Skill's privacy guidance.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/vendor/amap_index.js:23
Finding

AMap API Key Can Be Persisted in a Plaintext Package File

Content
View full analysis

Vulnerability Details

File Location: scripts/vendor/amap_index.js:23-31
Related Locations: scripts/vendor/amap_index.js:6,41-46,384-395
Vulnerability Type: Plaintext credential storage with unrestricted default file permissions
Risk Level: Medium

Vulnerable Code

javascript
const CONFIG_FILE = path.join(__dirname, 'config.json');
javascript
function saveConfig(config) {
  try {
    fs.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2), 'utf8');
    console.log('配置已保存到:', CONFIG_FILE);
    return true;
  } catch (error) {
    console.error('保存配置文件失败:', error.message);
    return false;
  }
}
javascript
function setWebServiceKey(key) {
  const config = readConfig();
  config.webServiceKey = key;
  return saveConfig(config);
}

The credential setter is exported to other modules:

javascript
module.exports = {
  readConfig,
  saveConfig,
  getWebServiceKey,
  setWebServiceKey,
  ensureWebServiceKey,
  searchPOI,
  walkingRoute,
  drivingRoute,
  ridingRoute,
  transitRoute,
  generateMapLink,
  travelPlanner
};

Technical Analysis

setWebServiceKey stores the AMap Web Service key in scripts/vendor/config.json, inside the Skill package directory. The key is serialized as plaintext JSON. fs.writeFileSync is called without an explicit restrictive mode, so the resulting permissions depend on the process umask and environment.

Although the reviewed workflow primarily documents environment-variable configuration, the credential-persistence capability remains exported and available to callers. A local caller, integration, or future code path can persist the key without encryption, access controls, rotation support, or exclusion rules demonstrated in the project.

Storing secrets within a package tree also creates a risk that the generated file will be copied into backups, archives, support bundles, or ...[truncated 1070 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove setWebServiceKey, saveConfig, and package-local secret persistence if they are unnecessary.
  2. Accept the API key only through environment injection or a supported secret-management service.
  3. If persistence is unavoidable, store the secret outside the project tree in an operating-system-specific protected configuration directory.
  4. Create any credential file with owner-only permissions, such as mode 0600, and verify ownership before reading it.
  5. Do not print credential values or include them in errors, generated URLs, or debug logs.
  6. Add scripts/vendor/config.json to ignore and packaging-exclusion rules as defense in depth.
  7. Document key rotation and revocation procedures.
  8. Restrict the AMap key by supported service, quota, and source controls in the provider console.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (44)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This mismatch includes undocumented local config read/write of API keys and broader POI/tourism functionality outside the declared medical scope. In a medical assistant context, undeclared storage of secrets and broader-than-expected data handling can expand the attack surface and mislead users about what data is being accessed or persisted.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This mismatch includes undocumented local config read/write of API keys and broader POI/tourism functionality outside the declared medical scope. In a medical assistant context, undeclared storage of secrets and broader-than-expected data handling can expand the attack surface and mislead users about what data is being accessed or persisted.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This mismatch includes undocumented local config read/write of API keys and broader POI/tourism functionality outside the declared medical scope. In a medical assistant context, undeclared storage of secrets and broader-than-expected data handling can expand the attack surface and mislead users about what data is being accessed or persisted.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This mismatch includes undocumented local config read/write of API keys and broader POI/tourism functionality outside the declared medical scope. In a medical assistant context, undeclared storage of secrets and broader-than-expected data handling can expand the attack surface and mislead users about what data is being accessed or persisted.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This mismatch includes undocumented local config read/write of API keys and broader POI/tourism functionality outside the declared medical scope. In a medical assistant context, undeclared storage of secrets and broader-than-expected data handling can expand the attack surface and mislead users about what data is being accessed or persisted.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This mismatch includes undocumented local config read/write of API keys and broader POI/tourism functionality outside the declared medical scope. In a medical assistant context, undeclared storage of secrets and broader-than-expected data handling can expand the attack surface and mislead users about what data is being accessed or persisted.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This mismatch includes undocumented local config read/write of API keys and broader POI/tourism functionality outside the declared medical scope. In a medical assistant context, undeclared storage of secrets and broader-than-expected data handling can expand the attack surface and mislead users about what data is being accessed or persisted.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This mismatch includes undocumented local config read/write of API keys and broader POI/tourism functionality outside the declared medical scope. In a medical assistant context, undeclared storage of secrets and broader-than-expected data handling can expand the attack surface and mislead users about what data is being accessed or persisted.

Content

No source excerpt is available for this finding.

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/hospital_extracted_final.csv (reported line 1)May include surrounding context.

text
"hospital_name","hospital_intro","department_name","department_intro","doctor_name","doctor_department","doctor_intro","doctor_schedule"
"中日友好医院","","呼吸与危重症医学科","","王辰","呼吸与危重症医学科","",""
"中日友好医院","","中医妇科","","许润三","中医妇科","",""
"中日友好医院","","呼吸与危重症医学科","","曹彬","呼吸与危重症医学科","",""

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README is written as a Chinese-only skill description for medical-care workflow use, with no indication that users may choose another language or that the locale restriction is required. This can constitute a language/locale policy violation because it implicitly fixes the interaction language without opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README states that the skill will first attempt IP-based coarse location to support route planning, but it does not mention obtaining user consent, explaining the privacy implications, or offering an opt-in flow before location inference. In a medical-care workflow, location data can be sensitive because it can reveal where a user lives or is seeking treatment, so silent collection or inference increases privacy risk.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill declares executable capabilities and access to environment variables/files but does not define any explicit tool scope such as allowed-tools or permissions. In a medical workflow that handles potentially sensitive health data and API keys, this increases the chance of unintended file/env access or privilege creep at runtime.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes an outpatient care workflow skill focused on triage, hospital/doctor recommendation, appointment guidance, reminders, post-visit explanation, and route planning. Line L053 adds a capability to suggest using a separate poster/design skill to generate Xiaohongshu/朋友圈 sharing copy, which is not justified by the stated medical-care-management purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Defaulting the user's city to Beijing without opt-in can produce unsafe or misleading medical guidance, hospital recommendations, and registration instructions for users elsewhere. In healthcare workflows, locale assumptions can materially affect access, urgency guidance, and routing, making the context more dangerous than a generic recommendation error.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs automatic creation of reminders or calendar entries when the environment supports it, without an explicit consent checkpoint. In a medical context this can cause unauthorized actions on a user's behalf and may leak sensitive appointment or medication details into calendars/notification systems without clear approval.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

These lines tell the skill to proactively recommend generating publishable social-media experience copy after completing the medical workflow. That capability is orthogonal to triage, appointment support, reminders, explanation, and navigation, making it context-inappropriate for the skill's declared purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The playbook instructs the system to attempt real user IP geolocation before asking the user, without a clear notice or consent flow. IP-derived location is privacy-sensitive, and in a medical-routing context it can reveal or infer where a person is seeking treatment, creating heightened confidentiality concerns.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The playbook introduces an optional handoff to a separate social-media copywriting skill that is outside the declared medical-care management purpose. In a medical context, this expands data use beyond the user's care workflow and can encourage disclosure or repurposing of sensitive health information for non-essential content generation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The post-visit flow again encourages generating social-sharing copy after processing records, prescriptions, and reports. Because this comes immediately after handling highly sensitive medical data, it increases the risk that private health details are transformed into outward-facing content without a sufficiently distinct purpose boundary.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Embedding a standard closing instruction to always suggest social-media content creation normalizes cross-purpose data use and makes the unrelated behavior systematic rather than incidental. In a healthcare skill, routinely nudging users toward publishing their medical journey can create privacy harm and violates least-privilege/purpose-limitation expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The entire response template is written as prescriptive Chinese output sections such as '推荐输出模板' and fixed Chinese phrasing for all stages of care. This indicates the skill is expected to respond in Chinese by default, but the file does not mention any user language preference, opt-in, or justified locale restriction.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The template instructs the medical-care workflow to promote an unrelated social-media copywriting skill, which creates cross-skill scope expansion without a user need tied to care delivery. In a medical context, this can distract from clinical guidance, increase unnecessary sharing of sensitive health experiences, and route users into functionality outside the stated purpose of the skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The enhanced post-visit template repeats the suggestion to generate publishable social-media content, again pushing the conversation beyond the medical workflow. Because this appears at the end of post-visit guidance, it may encourage disclosure of private medical details at a sensitive moment and normalizes unrelated tool invocation inside a healthcare-oriented skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file presents all user-facing guidance exclusively in Chinese and does not indicate any language choice or opt-in. Under the stated policy, forcing a specific language without offering the user a locale choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code sends the user-provided address to an external AMap geocoding service and includes an API credential from environment variables, but the script provides no confirmation prompt, warning message, or explanatory comment/docstring about that data transmission. Because this is a code file and the network call exposes user/system data to a third party, it meets the missing user warning criteria.

Content

No source excerpt is available for this finding.