Back to skill

Security audit

Calendar Sync

Security checks for vulnerabilities and agentic risk

Overview

This calendar skill is mostly purpose-aligned, but its optional AppleScript path can execute unsafe script content derived from document data.

Review proposed events before importing them, avoid the AppleScript method unless the input JSON is trusted, and assume event notes may sync to Apple/iCloud calendars and expose document summaries, amounts, source paths, IDs, or Notion links. Prefer ICS-only use with redacted notes until the AppleScript injection issue is fixed and dependency versions are pinned.

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

T09 · Insecure Skill Coding Practices

Error
Location
calendar_sync.py:192
Finding
AppleScript Injection Through Untrusted Calendar Data<![CDATA[ ## Vulnerability Details **File Location**: `calendar_sync.py`, lines 192–224 **Vulnerability Type**: AppleScript code injection **Risk Level**: High ### Vulnerable Code ```python def register_via_applescript(docs): """macOS에서 AppleScript로 직접 캘린더에 등록""" if platform.system() != "Darwin": return False, "macOS가 아닙니다." success_count = 0 errors = [] for doc in docs: dates = doc.get("dates", {}) title = create_event_title(doc) description = create_event_description(doc).replace('"', '\\"').replace('\n', '\\n') deadline = dates.get("deadline") if not deadline: continue # AppleScript 생성 script = f''' tell application "Calendar" if not (exists calendar "문서 일정") then make new calendar with properties {{name:"문서 일정"}} end if tell calendar "문서 일정" set eventDate to date "{deadline}" make new event with properties {{ summary:"{title} - 마감", start date:eventDate, allday event:true, description:"{description}" }} end tell end tell ''' try: result = subprocess.run( ['osascript', '-e', script], capture_output=True, text=True, timeout=10 ) ``` ### Technical Analysis The `register_via_applescript` function constructs executable AppleScript by interpolating fields originating from the input JSON directly into quoted AppleScript literals. In particular: - `title` is derived from attacker-controllable `doc_type` and `title` properties. - `deadline` is read directly from `dates.deadline`. - Neither field is safely encoded before being inserted into the script. - The `deadline` used by this execution path is not passed through the existing `parse_date()` validator. - Although `description` receive ...[truncated 1906 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not interpolate untrusted values into executable AppleScript source. 2. Pass document values as separate `osascript` arguments and retrieve them through an `on run argv` handler. For example: ```python script = ''' on run argv set eventTitle to item 1 of argv set deadlineText to item 2 of argv set eventDescription to item 3 of argv tell application "Calendar" if not (exists calendar "문서 일정") then make new calendar with properties {name:"문서 일정"} end if tell calendar "문서 일정" set eventDate to date deadlineText make new event with properties {summary:eventTitle, start date:eventDate, allday event:true, description:eventDescription} end tell end tell end run ''' result = subprocess.run( [ "osascript", "-e", script, f"{title} - 마감", validated_deadline, description, ], capture_output=True, text=True, timeout=10, check=False, ) ``` 3. Validate `dates.deadline` with `parse_date()` before the AppleScript path and reformat the validated object using a fixed format. Reject the record if parsing fails. 4. Apply schema validation to the entire JSON input, including type checks and reasonable maximum lengths. 5. Avoid relying on manual quote replacement as a general-purpose AppleScript encoder. 6. Add regression tests containing quotes, backslashes, newlines, AppleScript delimiters, and attempted injected statements. 7. Prefer ICS generation when direct Calendar automation is unnecessary, because it avoids executing dynamically generated scripts. ]]>

T08 · Insecure Dependencies

Note
Location
system-prompt.md:13
Finding
Unpinned Third-Party Dependency Installation<![CDATA[ ## Vulnerability Details **File Location**: `system-prompt.md`, lines 13–16 **Vulnerability Type**: Unpinned runtime dependency **Risk Level**: Low ### Vulnerable Code ```markdown ### 필수 설치 ``` pip install icalendar ``` ``` ### Technical Analysis The system prompt instructs the agent or user to install `icalendar` without a version constraint or integrity hash. Consequently, the installed code depends on whichever package version the configured package index resolves at execution time. This makes installation non-reproducible and prevents the project from guaranteeing that the installed package is the version that was reviewed and tested. The instruction does not itself demonstrate a malicious package or dependency-confusion attack, but it creates avoidable supply-chain exposure to a compromised upstream release, an unexpected breaking release, or use of an unintended package index. ### Attack Path 1. The environment does not already contain the required `icalendar` package. 2. An agent or user follows the documented `pip install icalendar` instruction. 3. `pip` resolves the package from the environment's configured index without a project-defined version or hash. 4. A compromised, unexpectedly changed, or otherwise unsafe resolved release is downloaded. 5. Package installation or subsequent import executes that package's code with the privileges of the user running the skill. Exploitation depends on compromise or manipulation of the upstream package, package index, network trust path, or local package-manager configuration. ### Impact Assessment A malicious resolved dependency could execute Python code during installation or when imported by `calendar_sync.py`. Such code would run with the current user's privileges and could potentially access files, environment variables, or network resources available to that user. No evidence was found that the named `icalendar` package is malicious. The finding concerns the absence of version and integr ...[truncated 52 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Select and review a specific compatible `icalendar` release. 2. Declare it in a dedicated dependency file with an exact version pin, for example: ```text icalendar==<reviewed-version> ``` 3. Generate and enforce cryptographic hashes, such as through a lock file or: ```text icalendar==<reviewed-version> \ --hash=sha256:<verified-package-hash> ``` 4. Install dependencies in an isolated virtual environment rather than the user's global Python environment. 5. Use an explicitly configured trusted package index and avoid accepting arbitrary extra indexes. 6. Add automated dependency vulnerability and update monitoring. 7. Test dependency upgrades before changing the pinned version. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The declared purpose suggests calendar syncing from structured dates, but the implementation scope also includes direct local application control, file generation, and exporting sensitive document metadata into calendar entries. This mismatch matters because users may approve a seemingly simple scheduling skill without realizing it can manipulate local apps and replicate private data into broadly visible calendar records.

Lp3

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding
The skill advertises code-capable behavior such as shell/AppleScript execution and file interaction, but it does not declare any explicit tool scope or permission boundaries. That omission increases the chance an agent will execute side-effecting operations without clear user consent or runtime restriction, especially because this skill can modify local Calendar data and potentially write ICS files.

Natural-Language Policy Violations

Medium
Confidence
86% confidence
Finding
The manifest description and examples are entirely in Korean, and the ICS sample sets a Korean locale marker ('//KO'), indicating an assumed language/locale. There is no opt-in language choice or documented justification that this skill is intentionally limited to Korean users or Korean-language documents.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill is designed to automatically create calendar events from parsed documents, but it does not prominently warn that it will modify the user's calendar data. Automatic insertion of deadlines and events can cause integrity issues, clutter, or accidental disclosure via synced calendars if done without explicit approval and review.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
Including Notion links, original file paths, summaries, and financial information in calendar notes can leak sensitive metadata into a system that is often synced across devices, shared with assistants, or visible in notifications. Even if the calendar action is expected, replicating document internals into event descriptions materially expands exposure beyond the original document system.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The AppleScript path directly creates a calendar and inserts events in the local Calendar application, which is a real state-changing system action. Without an explicit warning and confirmation boundary, an agent using this skill could silently alter user data, create persistent entries, or propagate sensitive information through calendar sync services.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The file description, calendar names, CLI usage text, and status messages are all hard-coded in Korean, indicating the skill is intended to operate only in that language. The policy requires either offering a language/locale choice or clearly documenting and justifying a locale-specific constraint, which is not present here.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
'''

        try:
            result = subprocess.run(
                ['osascript', '-e', script],
                capture_output=True, text=True, timeout=10
            )
Confidence
93% confidence
Finding
The AppleScript passed to osascript is built with untrusted document fields such as title and description interpolated directly into the script body. Only the description is partially escaped, while the title is not escaped at all and other AppleScript-special characters are not handled robustly, so crafted input can break out of the string context and alter script behavior, potentially executing arbitrary AppleScript actions on the host.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The manifest description promises automatic reflection of extracted schedules into Apple Calendar. In the implementation, sync_to_calendar defaults to method="ics" and merely writes an ICS file, then instructs the user to double-click or import it manually unless an explicit AppleScript mode is selected on macOS.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill instructs generating ICS calendar files whose event description/memo explicitly includes potentially sensitive business metadata such as sender, assignee, summary, amount, Notion link, and source file. Calendar imports can sync broadly across devices/accounts and make this metadata more exposed than the original document context, yet the prompt provides no minimization guidance, consent step, or warning to the user.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill recommends AppleScript execution through osascript for calendar creation, which is a system-modifying action affecting the user's local Calendar data. Because the prompt includes no confirmation, dry-run preview, or safety guidance, it increases the risk of unintended event creation, duplication, or user approval bypass in an automation chain that is explicitly designed to auto-register extracted schedules.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The prompt instructs the agent to perform direct Apple Calendar registration via AppleScript, which is a state-changing action on the user's system and can leak document metadata by placing source details into calendar notes. Because the prompt does not require explicit informed consent or warn about what fields will be exported, users may unintentionally create events containing sensitive internal information.

Intent-Code Divergence

Low
Confidence
82% confidence
Finding
The top-level docstring describes the script as choosing between ICS creation or direct AppleScript registration. However, the main flow unconditionally generates an ICS file and treats AppleScript as an optional additional step, so the documentation presents the behavior as an either-or path when the code is not structured that way.

Natural-Language Policy Violations

Low
Confidence
78% confidence
Finding
The instructions, labels, and examples are entirely in Korean, and the calendar metadata includes a locale-specific identifier ('KO') without any note that the skill is Korea-specific or that users may choose another language. This may violate language/locale policy if the organization expects skills not to force a language without opt-in.

Natural-Language Policy Violations

Low
Confidence
76% confidence
Finding
Nearly all operational instructions and output format are specified only in Korean, which can amount to a language/locale policy constraint if the skill is expected to serve general users. The file does not offer user opt-in for Korean nor explain that the skill is intentionally limited to a Korean-speaking or region-specific context.

Static analysis

Detected: suspicious.prompt_injection_instructions

Prompt-injection style instruction pattern detected.

Warn
Code
suspicious.prompt_injection_instructions
Location
system-prompt.md:1