Back to skill

Security audit

智能照护排班

Security checks for vulnerabilities and agentic risk

Overview

This scheduling skill is mostly purpose-aligned, but it under-discloses external AI data transmission, local CSV persistence, and browser-side security flaws involving staff roster data.

Review before installing. Use only non-sensitive or pseudonymized staff identifiers unless the publisher adds clear disclosure and consent for DashScope AI use, fixes browser HTML rendering, and makes CSV export explicitly user-directed and spreadsheet-safe. Generated schedules should be manually checked for coverage and rule compliance before use in care operations.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (5)

T09 · Insecure Skill Coding Practices

Error
Location
assets/app.js:168
Finding

DOM-Based Cross-Site Scripting Through Unescaped Staff Input

Content
View full analysis
...
${this.renderStep()}
... `; document.getElementById('app').innerHTML = html; }, renderStaffStep() { return `

👥 添加工作人员

请输入工作人员姓名或编号,每行一个

${this.staffInput}
💡 提示:可以用编号+姓名,如 "001 张护士"
`; }, ``` ### Technical Analysis The application places `this.staffInput`, which contains user-controlled staff data, directly inside an HTML template. The completed template is then parsed using the `innerHTML` sink. No HTML escaping or sanitization is applied. An attacker can close the `textarea` element and inject active HTML containing an event handler or another executable browser construct. Because the payload is parsed as markup rather than assigned as a text value, it can execute in the security context of the application's origin. For example, a malicious staff entry can use a structure equivalent to: ```html ``` The vulnerability can be triggered when the application renders the staff-entry step after the malicious value has been saved into `App.staffInput`. ### Attack Path 1. An attacker provides or persuades a user to paste a malicious staff entry into the staff input field. 2. The user advances to the next step, causing the application to save the field value in `App.staffInput`. 3. The user returns to the staff-entry step, or another application action calls `App.render()`. 4. `renderStaffStep()` embeds the malicious value into ...[truncated 796 chars]
Remediation
View remediation
`, `"`, and `'`. 4. Prefer a templating framework that escapes interpolated values by default. 5. Remove inline event handlers and register handlers with `addEventListener`. 6. Add a restrictive Content Security Policy as defense in depth, for example by disallowing inline scripts and event handlers. A CSP must not be treated as a replacement for output encoding. 7. Add automated security tests using values that contain closing tags, event handlers, quotes, and other HTML metacharacters. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
assets/app.js:316
Finding

DOM-Based Cross-Site Scripting Through Untrusted AI Schedule Output

Content
View full analysis
{ html += ` ${ScheduleApp.formatDate(date)}${s.shift} ${s.time} ${s.staff} ${i === 0 ? `` : ''} `; }); ``` The remote model response is parsed as JSON but is not validated or sanitized: ```javascript const json = await resp.json(); const content = json.choices?.[0]?.message?.content || ''; const match = content.match(/\[[\s\S]*\]/); if (!match) throw new Error('无法解析结果'); return JSON.parse(match[0]); ``` The generated schedule is subsequently included in the page through the application's `innerHTML` rendering flow. ### Technical Analysis JSON parsing establishes only that the response has syntactically valid JSON. It does not establish that fields such as `shift`, `time`, or `staff` are safe HTML text. Staff names are included in the model prompt. A malicious staff value can therefore attempt prompt injection and instruct the model to return HTML in one of the expected JSON string fields. A compromised, manipulated, or unexpectedly behaving model endpoint could return the same content directly. Because the parsed model fields are interpolated into an HTML string without output encoding, active markup returned in `s.staff`, `s.shift`, or `s.time` can become executable DOM content. ### Attack Path 1. The user enables AI generation by supplying a DashScope API key. 2. An attacker-controlled staff entry is included in the prompt sent to the model. 3. The entry instructs or influences the model to place an HTML payload in a valid JSON schedule field. 4. `generateWithAI()` extracts the first bra ...[truncated 968 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
assets/app.js:109
Finding

Spreadsheet Formula Injection and Improper CSV Serialization in Browser Export

Content
View full analysis
rows.push([s.date, s.shift, s.time, s.staff])); const csv = rows.map(r => r.join(',')).join('\n'); const blob = new Blob(['\ufeff' + csv], { type: 'text/csv;charset=utf-8' }); const link = document.createElement('a'); link.href = URL.createObjectURL(blob); link.download = filename; link.click(); } ``` ### Technical Analysis Schedule fields include staff names controlled by application users and, in AI mode, fields returned by a remote model. These values are exported without neutralizing spreadsheet formula prefixes. Spreadsheet applications may interpret cells beginning with `=`, `+`, `-`, or `@` as formulas. A malicious staff entry can therefore become an executable spreadsheet expression when the exported file is opened. The implementation also creates CSV by joining fields with commas. It does not quote fields containing commas, double quotes, carriage returns, or newlines. Consequently, attacker-controlled content can create additional cells or rows and change the apparent structure of the exported schedule. ### Attack Path 1. An attacker supplies a staff name beginning with a spreadsheet formula prefix, or influences AI output to contain such a value. 2. The application includes the value in `schedule`. 3. The user selects the CSV export function. 4. `exportCSV()` writes the value directly to the generated CSV without formula neutralization. 5. The user opens the CSV in formula-evaluating spreadsheet software. 6. The spreadsheet interprets the malicious cell as a formula, subject to the software's security settings. A malicious value containing commas or newlines can additionally inject misleading rows or columns because the expo ...[truncated 559 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scheduler.py:124
Finding

Spreadsheet Formula Injection in Python CSV Export

Content
View full analysis
Remediation
View remediation

other

Warning
Location
scheduler.py:72
Finding

Scheduling Constraint Failures Can Produce Unsafe and Understaffed Schedules

Content
View full analysis
0) if s["shifts"] >= self.shifts_per_week: continue # 检查是否连续排班 if s["last_date"]: last = datetime.strptime(s["last_date"], "%Y-%m-%d") current = datetime.strptime(date_str, "%Y-%m-%d") if (current - last).days < 2: # 48小时内连续 continue # 检查夜班后休息 if shift["id"] == "morning" and s.get("last_shift") == "night": continue # 按已上班次排序,少的优先 available.append(s) available.sort(key=lambda x: x["shifts"]) # 分配员工 for s in available: if len(assigned) >= shift["required"]: break assigned.append(s["name"]) s["shifts"] += 1 s["last_date"] = date_str s["last_shift"] = shift["id"] return assigned ``` The caller records any partially assigned shift as long as at least one worker was selected: ```python assigned = self._assign_staff(shift, weekday, date_str) if assigned: schedule.append({ "date": date_str, "weekday": self.WEEKDAYS[weekday], "shift": shift["name"], "time": f"{shift['start']}-{shift['end']}", "staff": "、".join(assigned) }) ``` ### Technical Analysis The implementation documents a per-week shift limit, bu ...[truncated 2418 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (18)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared behavior says the skill completes scheduling through dialogue, but the analyzed implementation reportedly also supports external network calls and CSV export that are not disclosed. This mismatch is dangerous because it can mislead users into providing potentially sensitive personnel scheduling data under the assumption of a simple local conversational tool, while the system may transmit or persist that data elsewhere.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
82% confidence
Finding

The skill metadata does not declare any tool permissions, yet the associated implementation is reported to have file-write and network capabilities. This creates a transparency and least-privilege problem: users and reviewers cannot accurately assess what the skill may do, and hidden network/export behavior could expose staffing or caregiver data outside the expected local scheduling flow.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrase “帮我排个班” is overly broad and can match many unrelated scheduling requests outside elder-care staffing. Overbroad activation can cause the wrong skill to engage, leading users to disclose staffing names, shift preferences, or operational details to an unintended workflow.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrase “生成排班表” is generic and not limited to elder-care or nursing scenarios. This raises the risk of accidental invocation for other business, school, or personal scheduling tasks, which can expose unrelated operational data to a skill with capabilities beyond what the user intended.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The UI presents AI generation as an optional convenience but does not clearly warn users that entering an API key will cause staff names and scheduling details to be sent to an external service. In a养老/护理 setting, users may reasonably assume roster data stays local, so the lack of notice materially increases the chance of unintended disclosure.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill’s stated purpose is local conversational scheduling, but when an API key is provided it sends staff names, staffing constraints, and dates to a third-party AI endpoint. In a care-facility context, personnel rosters and schedules are operationally sensitive, and transmitting them externally without clear disclosure or minimization creates a real privacy and security risk.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

This fetch call transmits user-supplied scheduling data to an external endpoint. In the context of elder-care staffing, even basic staff rosters and shift assignments can be sensitive operational information, so uncontrolled external transmission is a genuine security/privacy concern.

Content

Scanner excerpt · assets/app.js (reported line 464)May include surrounding context.

js
[{"date": "2024-01-01", "shift": "早班", "time": "07:00-15:00", "staff": "张三、李四"}]
`;

    const resp = await fetch('https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code includes a remote chat-completions call that is not essential to the core scheduling functionality because a local scheduling algorithm already exists. That external capability expands the attack surface and creates a path for sensitive operational data and credentials to leave the client environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The outbound request sends schedule prompt content containing staff names and dates, and uses a bearer API credential, yet there is no user-facing disclosure, consent checkpoint, or masking/minimization. This is dangerous because it can expose sensitive workforce information to a third party and encourages users to paste credentials into the app without adequate trust context.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module claims to be a 'pure conversational' scheduling generator, but the code includes file-export side effects. This mismatch is security-relevant because users and orchestrators may grant the skill access based on a lower-risk mental model, while the actual behavior persists potentially sensitive staffing data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module description and all user-facing labels are written exclusively in Chinese, and the file presents itself as a dialogue-based scheduling generator without offering any language or locale selection. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill is described as completing scheduling through conversation, but the implementation also writes a CSV file to local disk. In a care-facility context, the schedule contains employee names and work assignments, so undisclosed persistence can create privacy, retention, and data-handling risks, especially in sandboxed agent environments where users may not expect file side effects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The CSV export writes scheduling data to disk without any warning or confirmation in the code path that performs the write. Because staff rosters and shift assignments are operationally sensitive, silent export can lead to unintended data persistence, accidental disclosure through shared working directories, or policy violations in environments that expect ephemeral processing only.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

全文从名称、描述到示例均固定为中文交互,未说明是否支持其他语言,也没有让用户选择语言的机制。根据规则,若技能强制特定语言且无用户 opt-in,可视为自然语言政策风险。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code explicitly formats dates using the 'zh-CN' locale, and the interface text throughout the file is fixed in Chinese. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy concern unless the regional restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document declares lang="zh-CN", which sets a specific language/locale for the skill interface. Under the policy, forcing a specific language without offering a user choice or documenting a justified locale restriction is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The stylesheet's human-readable comments are written entirely in Chinese, such as the title comment at L001 and section comments throughout the file. Under the stated policy, forcing a specific language without opt-in or a documented region-specific justification can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code file contains natural-language strings exclusively in Chinese, including the top-level comment, shift names, weekday names, and printed table headers. Under the policy rule for language/locale, this forces a specific language without any opt-in, fallback, or documented justification that the skill is region-specific.

Content

No source excerpt is available for this finding.