Back to skill

Security audit

workday-calendar

Security checks for vulnerabilities and agentic risk

Overview

The calendar skill is mostly coherent, but its web configuration server can expose and change local calendar data over the network without authentication.

Review before installing. Do not run scripts/settings.py on an untrusted network unless it is changed to bind only to 127.0.0.1 and protected with authentication. Treat imported rules and generated HTML as untrusted unless values are validated/escaped, and be aware the skill writes local calendar data and creates executable .bat backups.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/settings.py:44
Finding

Unauthenticated Configuration Server Exposes and Modifies Local Calendar Data

Content
View full analysis
dict: length = int(self.headers.get("Content-Length", 0)) if length == 0: return {} raw = self.rfile.read(length) return json.loads(raw.decode("utf-8")) def do_GET(self): if self.path == "/" or self.path == "/index.html": self._send_html(self._generate_page()) elif self.path == "/config": cfg = load_config() self._send_json(cfg) elif self.path == "/export-rules-template": year = datetime.now().year template = export_rules_template(year) self._send_json(template) elif self.path == "/export-board": year = datetime.now().year html = generate_weekly_board_html(year, embed_schedule=False) self._send_html(html) elif self.path == "/export-schedule-weekly": year = datetime.now().year html = generate_weekly_board_html(year, embed_schedule=True) self._send_html(html) elif self.p ...[truncated 3789 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/workday_calendar.py:2108
Finding

Stored HTML and Script Injection in Generated Calendar Exports

Content
View full analysis
str: year = template.get("year", datetime.now().year) rules = template.get("rules", {}) base_type = template.get("base_type", "holiday") result_lines = [] if base_type == "holiday": wc_data = rules.get("weekend_config", {}) if wc_data: wc = WeekendConfig.from_dict(wc_data) save_weekend_config(wc) result_lines.append(f"周末规则已导入 (休息日: {wc.weekends})") hi_data = rules.get("holiday_intervals", []) if hi_data: intervals = [HolidayInterval.from_dict(i) for i in hi_data] save_holiday_intervals(year, intervals) result_lines.append(f"法定假日已导入: {len(intervals)} 个假期") comp_data = rules.get("compensatory_days", []) if comp_data: days = [CompensatoryDay.from_dict(d) for d in comp_data] save_compensatory_days(year, days) result_lines.append(f"补班日已导入: {len(days)} 天") ``` The imported and locally stored values are interpolated directly into calendar HTML: ```python label = day_type if holiday_name and day_type == "假日": label = holiday_name timeline_html = "" if slots and len(slots) > 0 and day_type not in ("假日", "空"): timeline_html = '
' merged = [] for s in slots: if not merged or merged[-1]["color"] != s.color: merged.append({"color": s.color, "start": s.start, "end": s.end, "label": s.label}) else: merged[-1]["end"] = s.end total_min = 24 * 60 for seg in merged: start_m = int(seg[ ...[truncated 4798 chars]
Remediation
View remediation
` blocks as a separate output context. Continue preventing `` termination, but use a robust serializer designed for safe script embedding. 8. Add a restrictive Content Security Policy to generated exports, for example disallowing inline script and remote network destinations where functionality permits. 9. Validate imported rule schemas, including maximum string lengths and allowed character sets for fields that do not require markup. 10. Add regression tests using payloads targeting: - HTML text nodes - Quoted attributes - CSS class names - Inline style attributes - Script termination sequences 11. Ensure all export functions use the same centralized escaping and validation helpers so that one export format cannot bypass protections applied to another. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (43)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared purpose frames the skill as a calendar/workday manager, but the file describes materially broader behaviors including scheduling, automation, exports, and creation of executable recovery scripts. Hidden or under-declared capabilities increase the chance of unsafe invocation because users may consent to a simple calendar tool while unknowingly enabling automation or script generation with broader system impact.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 40)May include surrounding context.

md
> 📚 **渐进式加载**:本技能采用渐进式 MD 体系,`SKILL.md` 为入口(≤230行),详细内容拆分到 `references/*.md` 按需加载。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 80)May include surrounding context.

md
4. **核对** — 输入:已导入数据 → 运行 `python scripts/workday_calendar.py rules 20XX` → 输出:规则确认表

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 116)May include surrounding context.

md
4. **核对** — 输入:已导入数据 → 运行 `python scripts/workday_calendar.py rules 20XX` → 输出:规则确认表

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 147)May include surrounding context.

md
4. **核对** — 输入:已导入数据 → 运行 `python scripts/workday_calendar.py rules 20XX` → 输出:规则确认表

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/workday_calendar.py (reported line 371)May include surrounding context.

python
"""获取某天的排班时段(复制周一规则到二~五)"""
    rules = load_scheduling_rules()
    if weekday in rules and rules[weekday] is not None:
        return rules[weekday]
    if rules.get(0) and weekday in (1,2,3,4):
        return rules[0]
    # fallback

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/workday_calendar.py (reported line 373)May include surrounding context.

python
"""获取某天的排班时段(复制周一规则到二~五)"""
    rules = load_scheduling_rules()
    if weekday in rules and rules[weekday] is not None:
        return rules[weekday]
    if rules.get(0) and weekday in (1,2,3,4):
        return rules[0]
    # fallback

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/workday_calendar.py (reported line 439)May include surrounding context.

python
}
    rules.append(rule)
    save_auto_configs(rules)
    return rule, f"自动化规则已添加: {name}"


def delete_auto_rule(rule_id: str) -> str:

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill advertises low sensitivity and omits explicit tool scope even though the documented workflow clearly involves network access plus local data reads/writes. This creates a permission-transparency gap: users and the orchestrator may invoke a skill that can fetch external data and modify files without those capabilities being clearly declared and constrained.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list includes broad everyday terms like 日程, 安排, and 工作日, which can match many benign conversations outside the intended scope. Overbroad activation is dangerous here because the skill can read/write local schedule data and initiate network lookups, so accidental routing could expose or alter data without clear user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill supports adding, updating, and deleting schedule events, but the description does not clearly warn users that local calendar data may be modified or removed. This weakens informed consent and increases the risk of accidental destructive actions, especially when combined with broad triggers.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The positive examples explicitly endorse standalone keywords as sufficient triggers, which makes accidental invocation even more likely than contextual phrase matching. In a skill that can modify schedules and fetch external data, ambiguous one-word triggers raise the risk of unintended data changes or privacy-impacting behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The workflow says the skill must proactively query the web for official holiday notices when local data is missing, but this outbound access is not prominently disclosed as behavior visible to the user before activation. Unannounced network access can leak timing, locale, or query context and may surprise users who expect a local-only calendar skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list includes generic terms such as '日程', '安排', and '空闲时间' that are common in ordinary conversation and not uniquely tied to this skill. This can cause unintended invocation, routing user input into the calendar skill when the user did not intend it, increasing the chance of privacy-impacting context capture or incorrect automated actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This CLI reference includes rotation delete <id>, special delete <id>, and later delete <event_id> as available commands, but the surrounding documentation provides no warning that these actions remove existing data. For markdown files, commands that can affect user data should disclose destructive behavior or caution users before use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The documentation advertises import-rules '<json>' as a standard interface but does not warn users that importing rules may change existing configuration or scheduling data. In markdown skill documentation, operations that modify important configuration should include a clear user warning about impact and reversibility.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file is a markdown document, so natural-language policy checks apply. The content consistently forces a specific language/locale for all instructions and examples, and there is no opt-in, alternative language, or justification that the skill is intentionally limited to a Chinese-only regional context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The examples instruct the agent to delete or update calendar entries directly after identifying an ID, without showing any confirmation, preview, or ambiguity resolution step. In a scheduling skill, this can lead to accidental destructive changes to user data, especially when multiple events match or when natural-language requests are imprecise.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The guide explicitly documents automatic creation of Windows executable .bat backup files and tells users to restore them by double-clicking or invoking cmd. For a calendar/scheduling skill, generating executable scripts is unnecessary and expands the attack surface: if backup content or paths are influenced by schedule data, users are being trained to execute locally generated scripts, which can enable command injection or arbitrary command execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation normalizes silent creation of executable backup files and recommends executing them without any warning, integrity check, or explanation of the risks. This is dangerous because users may trust and run generated scripts from the application directory, making social engineering and persistence easier if those files are tampered with or generated from untrusted input.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The permissions document contains conflicting statements about whether the skill has network access, with one section declaring a HIGH-risk silent network capability and a later section claiming only local JSON read/write with no network access. This inconsistency can mislead reviewers and users into granting or relying on incorrect permissions, potentially hiding externally reachable behavior behind a 'low risk' description.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The statement '高权限操作:无' conflicts with the earlier table that records silent network access, which is explicitly marked HIGH risk. A misleading permissions summary weakens security review and informed consent, because operators may approve or deploy the skill under the false assumption that it has no elevated capabilities.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Claiming that the skill 'only performs local JSON data read/write' is inconsistent with the documented urllib-based network access in an earlier section. This can cause underestimation of the skill's attack surface, especially because the authorization mode is listed as silent, meaning remote communication could occur without user awareness.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/test-report.md (reported line 87)May include surrounding context.

md
| D4 | WARN | 裸 print 调用 | FAIL | scripts\workday_calendar.py:3044 | print("  auto check               - 检查并执行到时的定时任务") |
| D4 | WARN | 裸 print 调用 | FAIL | scripts\workday_calendar.py:3045 | print("  auto add <name> <hour> <min> <days> [--no |
| D4 | WARN | 裸 print 调用 | FAIL | scripts\workday_calendar.py:3046 | print("  auto list                - 列出定时任务") |
| D4 | WARN | 裸 print 调用 | FAIL | scripts\workday_calendar.py:3047 | print("  auto delete <id>         - 删除定时任务") |
| D4 | WARN | 裸 print 调用 | FAIL | scripts\workday_calendar.py:3048 | print("  auto preview <days> [--nosched] [--noshif |
| D4 | WARN | 裸 print 调用 | FAIL | scripts\workday_calendar.py:3049 | print() |
| D4 | WARN | 裸 print 调用 | FAIL | scripts\workday_calendar.py:3050 | print("HTML 导出:") |

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/test-report.md (reported line 144)May include surrounding context.

md
| D4 | WARN | 裸 print 调用 | FAIL | scripts\workday_calendar.py:3044 | print("  auto check               - 检查并执行到时的定时任务") |
| D4 | WARN | 裸 print 调用 | FAIL | scripts\workday_calendar.py:3045 | print("  auto add <name> <hour> <min> <days> [--no |
| D4 | WARN | 裸 print 调用 | FAIL | scripts\workday_calendar.py:3046 | print("  auto list                - 列出定时任务") |
| D4 | WARN | 裸 print 调用 | FAIL | scripts\workday_calendar.py:3047 | print("  auto delete <id>         - 删除定时任务") |
| D4 | WARN | 裸 print 调用 | FAIL | scripts\workday_calendar.py:3048 | print("  auto preview <days> [--nosched] [--noshif |
| D4 | WARN | 裸 print 调用 | FAIL | scripts\workday_calendar.py:3049 | print() |
| D4 | WARN | 裸 print 调用 | FAIL | scripts\workday_calendar.py:3050 | print("HTML 导出:") |

Static analysis

No suspicious patterns detected.