Back to skill

Security audit

apple-calendar-pro

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its calendar-management purpose, but it needs review because a URL-validation weakness could expose the user's iCloud app password while the tool can read and change calendars.

Install only if you are comfortable giving this skill an Apple app-specific password with access to your calendars. Prefer a dedicated app-specific password that you can revoke, avoid storing it in a shell profile, use an isolated Python environment with reviewed or pinned dependencies, and treat create/update/delete commands as capable of changing real calendar data. The URL-validation issue should be fixed before broad or unattended use.

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
scripts/applecal.py:481
Finding
Basic Authentication Credentials Can Be Forwarded to Unvalidated CalDAV Discovery URLs<![CDATA[ ## Vulnerability Details **File Location**: `scripts/applecal.py:481-550` **Vulnerability Type**: Insufficient validation of authentication destinations **Risk Level**: High ### Vulnerable Code ```python self.session = requests.Session() self.session.auth = HTTPBasicAuth(self.apple_id, self.password) self.session.headers.update({"User-Agent": user_agent, "Content-Type": "application/xml"}) # Retry on transient network errors (prefer idempotent methods to avoid duplicate writes) retry = Retry( total=MAX_RETRIES, backoff_factor=0.5, status_forcelist=[500, 502, 503, 504], allowed_methods=["GET", "HEAD", "OPTIONS", "PROPFIND", "REPORT"], ) adapter = HTTPAdapter(max_retries=retry) self.session.mount("https://", adapter) self.session.mount("http://", adapter) self.principal_url = None self.home_url = None self.outbox_url = None self.user_addresses = [] self._discover() def _request(self, method: str, url: str, **kwargs) -> requests.Response: """Wrapper around session.request with default timeout.""" kwargs.setdefault("timeout", DEFAULT_TIMEOUT) logger.debug("%s %s", method, url) resp = self.session.request(method, url, **kwargs) logger.debug("→ %s", resp.status_code) return resp ``` ```python parsed = urlparse(resp.url) server_root = f"{parsed.scheme}://{parsed.netloc}" self.principal_url = href if href.startswith("http") else urljoin(server_root, href) # 2. Calendar Home, Outbox, and User Addresses body = '''<?xml version="1.0"?> <d:propfind xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav"> <d:prop> <c:calendar-home-set/> <c:schedule-outbox-URL/> <c:calendar-user-address-set/> </d:prop> </d:propfind>''' resp = self._request("PROPFIND", self.principal_url, headers={"Depth": "0"}, data=body) resp.raise_for_status() root = parse_xml(resp.text) # Home home_el = root.find(".//{urn:ietf:params:xml:ns:caldav}calendar-home-set") home_href = get_href(home_el) if not home_href: ...[truncated 2974 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Create a centralized URL-validation function and apply it before every authenticated request. 2. Require `https` and reject plain HTTP: ```python parsed = urlparse(candidate_url) if parsed.scheme != "https": raise RuntimeError("CalDAV URL must use HTTPS") ``` 3. Maintain a strict allowlist of expected Apple CalDAV hostnames or validated hostname suffixes. Avoid substring checks; compare normalized hostnames exactly or against a carefully bounded suffix. 4. Reject URLs containing unexpected user-information, nonstandard ports, fragments, or malformed hostnames. 5. Resolve relative URLs against an already validated origin, then validate the final absolute URL again. 6. Disable automatic redirects for authenticated requests or manually follow redirects only after validating each destination: ```python resp = self.session.request( method, url, allow_redirects=False, **kwargs, ) ``` 7. Avoid session-wide authentication. Attach credentials only after the final request destination has passed origin and TLS validation. 8. Remove the HTTP adapter unless cleartext HTTP is explicitly required; it is inappropriate for requests carrying calendar credentials. 9. Add tests covering absolute cross-origin URLs, HTTP downgrade URLs, hostname-suffix bypasses, user-information URLs, and cross-origin redirects. ]]>

T08 · Insecure Dependencies

Warning
Location
README.md:18
Finding
Unpinned Third-Party Dependency Installation Creates Supply-Chain Risk<![CDATA[ ## Vulnerability Details **File Location**: `README.md:18-24` **Vulnerability Type**: Unpinned and unverifiable dependency installation **Risk Level**: Medium ### Vulnerable Code ```bash pip3 install requests # optional (recommended off-macOS): pip3 install keyring ``` ### Technical Analysis The documented installation process installs `requests` and `keyring` without exact versions, a lock file, or package hashes. Package resolution therefore depends on the mutable state of the configured Python package index at installation time. Transitive dependencies are likewise not fixed or integrity-verified. This does not prove that either named dependency is malicious. However, it makes builds non-reproducible and increases exposure to compromised releases, compromised package-index infrastructure, dependency-resolution changes, or malicious transitive packages. The risk is significant in this project because dependencies execute in the same Python process that handles the `APPLECAL_PASSWORD` environment variable, keyring access, macOS Keychain results, calendar data, and attachment files. ### Attack Path 1. An attacker compromises a permitted dependency release, one of its transitive dependencies, or the package-distribution path used by the installer. 2. A user follows the documented `pip3 install requests` or `pip3 install keyring` instructions. 3. Because no exact version or hash is required, `pip` resolves and installs the affected release. 4. Malicious package code executes during installation or when imported by `applecal.py`. 5. The malicious code operates with the privileges of the user running the CLI and can attempt to access calendar credentials and data available to that process. ### Impact Assessment Potential impact is bounded by the privileges of the user and Python environment running the installation or CLI. A compromised dependency could potentially: - Read `APPLECAL_PASSWORD` from the process environment. - Interact with confi ...[truncated 415 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Provide a reviewed requirements or lock file containing exact dependency versions. 2. Generate and publish cryptographic hashes for every direct and transitive dependency. 3. Require hash verification during installation, for example: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 4. Separate mandatory and optional dependencies into clearly maintained lock files or extras. 5. Document installation in an isolated virtual environment rather than the user's global Python environment. 6. Use a trusted package index explicitly and prevent unintended fallback to untrusted indexes. 7. Add automated dependency scanning and scheduled review of pinned versions. 8. Update pinned dependencies through controlled pull requests with test results and security review rather than resolving arbitrary latest releases at user installation time. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (35)

Credential Access

High
Category
Privilege Escalation
Content
```bash
pip3 install requests
# optional (recommended off-macOS):
pip3 install keyring
```

### 2. Generate an app-specific password
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
```bash
pip3 install requests
# optional (recommended off-macOS):
pip3 install keyring
```

### 2. Generate an app-specific password
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
```bash
pip3 install requests
# optional (recommended off-macOS):
pip3 install keyring
```

### 2. Generate an app-specific password
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
```bash
pip3 install requests
# optional (recommended off-macOS):
pip3 install keyring
```

### 2. Generate an app-specific password
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
```bash
pip3 install requests
# optional (recommended off-macOS):
pip3 install keyring
```

### 2. Generate an app-specific password
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
```bash
pip3 install requests
# optional (recommended off-macOS):
pip3 install keyring
```

### 2. Generate an app-specific password
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
```bash
pip3 install requests
# optional (recommended off-macOS):
pip3 install keyring
```

### 2. Generate an app-specific password
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
```bash
pip3 install requests
# optional (recommended off-macOS):
pip3 install keyring
```

### 2. Generate an app-specific password
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
```bash
pip3 install requests
# optional (recommended off-macOS):
pip3 install keyring
```

### 2. Generate an app-specific password
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
```bash
pip3 install requests
# optional (recommended off-macOS):
pip3 install keyring
```

### 2. Generate an app-specific password
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
```bash
pip3 install requests
# optional (recommended off-macOS):
pip3 install keyring
```

### 2. Generate an app-specific password
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Ae1

High
Category
analysis-evasion
Content
`scripts/applecal.py`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/applecal.py`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/applecal.py`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/applecal.py`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
`scripts/applecal.py`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Credential Access

High
Category
Privilege Escalation
Content
"author": "OpenClaw Fleet",
  "license": "MIT",
  "platform": "macos,linux,windows",
  "auth": "keychain (macOS) or APPLECAL_PASSWORD env var (cross-platform)",
  "requires": ["python3", "requests"],
  "keywords": ["calendar", "apple", "icloud", "caldav", "ics", "schedule"],
  "commands": {
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"author": "OpenClaw Fleet",
  "license": "MIT",
  "platform": "macos,linux,windows",
  "auth": "keychain (macOS) or APPLECAL_PASSWORD env var (cross-platform)",
  "requires": ["python3", "requests"],
  "keywords": ["calendar", "apple", "icloud", "caldav", "ics", "schedule"],
  "commands": {
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"author": "OpenClaw Fleet",
  "license": "MIT",
  "platform": "macos,linux,windows",
  "auth": "keychain (macOS) or APPLECAL_PASSWORD env var (cross-platform)",
  "requires": ["python3", "requests"],
  "keywords": ["calendar", "apple", "icloud", "caldav", "ics", "schedule"],
  "commands": {
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"author": "OpenClaw Fleet",
  "license": "MIT",
  "platform": "macos,linux,windows",
  "auth": "keychain (macOS) or APPLECAL_PASSWORD env var (cross-platform)",
  "requires": ["python3", "requests"],
  "keywords": ["calendar", "apple", "icloud", "caldav", "ics", "schedule"],
  "commands": {
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
"author": "OpenClaw Fleet",
  "license": "MIT",
  "platform": "macos,linux,windows",
  "auth": "keychain (macOS) or APPLECAL_PASSWORD env var (cross-platform)",
  "requires": ["python3", "requests"],
  "keywords": ["calendar", "apple", "icloud", "caldav", "ics", "schedule"],
  "commands": {
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- Event CRUD (List, Create, Update, Delete)
- RFC 8607 Managed Attachments (iPhone/iPad compatible)
- Free/Busy lookup (CalDAV scheduling + event-derived fallback)
- Keychain-based auth (no plaintext passwords)
- JSON-stable output for easy agent consumption

Requirements:
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- Event CRUD (List, Create, Update, Delete)
- RFC 8607 Managed Attachments (iPhone/iPad compatible)
- Free/Busy lookup (CalDAV scheduling + event-derived fallback)
- Keychain-based auth (no plaintext passwords)
- JSON-stable output for easy agent consumption

Requirements:
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- Event CRUD (List, Create, Update, Delete)
- RFC 8607 Managed Attachments (iPhone/iPad compatible)
- Free/Busy lookup (CalDAV scheduling + event-derived fallback)
- Keychain-based auth (no plaintext passwords)
- JSON-stable output for easy agent consumption

Requirements:
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
- Event CRUD (List, Create, Update, Delete)
- RFC 8607 Managed Attachments (iPhone/iPad compatible)
- Free/Busy lookup (CalDAV scheduling + event-derived fallback)
- Keychain-based auth (no plaintext passwords)
- JSON-stable output for easy agent consumption

Requirements:
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Static analysis

No suspicious patterns detected.