Back to skill

Security audit

Healthkit Code Review

Security checks for vulnerabilities and agentic risk

Overview

This is a documentation-only HealthKit code review skill, and its sensitive HealthKit examples fit its stated review purpose.

Install this as a HealthKit review aid, not as production code. Treat its write, sleep, characteristic, background-delivery, and server-sync snippets as examples to evaluate carefully, and ensure real apps add explicit user consent, clear privacy disclosure, minimal permissions, and secure handling for any health data access or transmission.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
### Required Setup

1. **Entitlement**: `com.apple.developer.healthkit` capability
2. **Info.plist Keys**:
   - `NSHealthShareUsageDescription` - Why app needs to **read** health data
   - `NSHealthUpdateUsageDescription` - Why app needs to **write** health data

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/authorization.md (reported line 10)May include surrounding context.

md
### Required Setup

1. **Entitlement**: `com.apple.developer.healthkit` capability
2. **Info.plist Keys**:
   - `NSHealthShareUsageDescription` - Why app needs to **read** health data
   - `NSHealthUpdateUsageDescription` - Why app needs to **write** health data

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/authorization.md (reported line 147)May include surrounding context.

md
### Required Setup

1. **Entitlement**: `com.apple.developer.healthkit` capability
2. **Info.plist Keys**:
   - `NSHealthShareUsageDescription` - Why app needs to **read** health data
   - `NSHealthUpdateUsageDescription` - Why app needs to **write** health data

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file includes sample code that creates and saves HealthKit samples, which affects sensitive user health data. The surrounding documentation explains how to perform the write but does not warn readers that these operations modify protected health records and require clear user awareness/consent handling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The sleep analysis section demonstrates creating and saving sleep samples, which are highly sensitive health records. Although the example is technically correct, the documentation does not include a user warning about privacy impact or the need for informed consent before recording such data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

This section documents reading immutable user health characteristics such as biological sex, which are sensitive personal data. The example mentions permission errors, but the markdown does not clearly warn that accessing such data has privacy implications and should be clearly disclosed to users.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The example code explicitly syncs HealthKit samples and deletions to a server, but it provides no user-facing disclosure, consent flow guidance, or privacy notice around off-device transmission of highly sensitive health data. In a HealthKit review skill, this omission is more dangerous because developers may copy the pattern directly and assume server sync is an acceptable default once HealthKit authorization exists, even though platform permission does not equal informed consent for remote sharing.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.