Back to skill

Security audit

Apple Photos Cleaner

Security checks for vulnerabilities and agentic risk

Overview

This is a local Apple Photos analysis and cleanup skill that handles sensitive photo metadata, but its access and mutation behavior are disclosed and purpose-aligned.

Install only if you are comfortable granting the running app read access to your Photos library. Treat generated reports like private photos because they may reveal names, faces, locations, travel patterns, and shared-library participants. Do not run cleanup or export commands unless you have reviewed the preview and explicitly approve the token-confirmed next command.

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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (62)

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
80% confidence
Finding

Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Content

Scanner excerpt · CONTRIBUTING.md (reported line 49)May include surrounding context.

md
**Removed** respectively.

**Exception: safety fixes.** If the old behavior lets something be deleted or written without
the user's informed approval, it can be removed immediately, with no warning period, and in
whatever release the fix lands in, including a minor or patch release. Waiting for a major would
leave the hole open. Call it out under a **Breaking (safety)** heading in the CHANGELOG, saying
what replaces it. See

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/test_common.py (reported line 436)May include surrounding context.

python
def test_strips_path_traversal(self):
        # The payload deliberately avoids real credential paths such as
        # /etc/passwd: ClawHub's scanner pattern-matches those literals and
        # reports them as credential access even inside a test.
        result = sanitize_folder_name("../..\\nested/folder")
        assert "/" not in result

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · tests/test_degradation.py (reported line 139)May include surrounding context.

python
target = sqlite3.connect(path)
    create_rich_db().backup(target)
    if table:
        target.execute(f'ALTER TABLE "{table}" DROP COLUMN "{column}"')
        target.commit()
    target.close()
    return path

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/test_flags.py (reported line 147)May include surrounding context.

python
stub = stub_dir / "osascript"
        stub.write_text('#!/bin/sh\necho "EXPORTED:0 SKIPPED:1"\n')
        stub.chmod(stub.stat().st_mode | stat.S_IEXEC)
        env = {**os.environ, "PATH": f"{stub_dir}{os.pathsep}{os.environ['PATH']}"}

        base = [
            sys.executable, str(ROOT / "scripts" / "smart_export.py"),

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/test_security.py (reported line 402)May include surrounding context.

python
stub = bin_dir / "osascript"
    stub.write_text(f'#!/bin/sh\necho call >> "{log}"\necho "DELETED:1 SKIPPED:0"\necho "EXPORTED:1 SKIPPED:0"\n')
    stub.chmod(0o755)
    env = {**os.environ, "PATH": f"{bin_dir}{os.pathsep}{os.environ.get('PATH', '')}"}
    assert shutil.which("osascript", path=env["PATH"]) == str(stub)

    return SimpleNamespace(env=env, calls=lambda: len(log.read_text().splitlines()) if log.exists() else 0)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The conversation triggers are broad natural-language requests like 'Are my photos well organized?' and 'How many photos aren't in any album?', which could match ordinary user intent without clearly signaling that a filesystem- or library-inspecting command will be invoked. This can cause the agent to run the auditing script unexpectedly, exposing metadata about a user's photo collection or performing analysis beyond what the user explicitly authorized.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly tells the AI to identify duplicates and recommend which files to delete, but it does not warn about irreversible data loss, edited variants, or false positives from heuristic matching. In photo-management context, even accurate duplicate detection can misclassify meaningful variants, causing users to delete wanted images based on overconfident automation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The example conversation triggers are broad enough that an assistant could invoke duplicate-finding during ordinary photo-help requests without clear user intent for filesystem or photo-library analysis. That increases the chance of unexpected access to personal photo metadata and could lead to unsolicited deletion recommendations in a sensitive data domain.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This command documentation encourages analysis of an Apple Photos library and explicitly highlights sensitive outputs such as people labels, date ranges, and storage breakdowns, but it provides no privacy warning, consent guidance, or data-handling caution. In an agent setting, that omission can normalize exposing personal metadata from a highly sensitive source and increase the chance of over-collection or disclosure to a user, log, or downstream tool without adequate notice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This command explicitly analyzes GPS-tagged photos, derives travel history, and exposes sensitive inferences such as top locations, trips, date ranges, and named people, but the description provides no privacy warning or consent guidance. In an agent context, this can normalize disclosure of highly sensitive location history and social associations without adequately alerting users to the privacy risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The command description explicitly surfaces sensitive personal photo metadata, including named individuals, locations/scenes, favorites, and date-based memory summaries, but provides no privacy warning or guidance about consent, audience, or safe display contexts. In conversational use, this increases the chance of unintended disclosure to bystanders, shared chats, logs, or downstream systems, especially because the skill encourages warm narration of personal memories rather than privacy-preserving output.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This command explicitly analyzes identifiable people in photos, including who appears most, who is photographed together, yearly trends, and 'best photo' selection, but provides no privacy notice, consent guidance, or disclosure about the sensitivity of biometric and relationship data. That creates a real privacy risk because the output can expose social graphs, behavioral patterns, and personal associations from a user's photo library without adequate warning or safeguards.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This documentation encourages running analytics over a personal photo library and explicitly derives behavioral patterns such as peak times, busiest days, streaks, and seasonal habits, but it provides no warning that the command processes sensitive personal metadata. Even without photo contents, this metadata can reveal routines, travel/activity patterns, sleep schedules, and other private behavioral signals that users may not expect to expose or summarize.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documented inventory mode enables generating a broad summary of the user's entire photo library contents without any privacy warning or consent cue. Because scene/category inventories can reveal sensitive habits, locations, interests, family details, or health-related context, users may be induced to disclose more than they realize.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The command description explicitly states it reports contributor identifiers and contribution breakdowns from a shared photo library, but it does not warn users that this may expose other participants' identifiers and activity patterns. In a personal-photo analysis context, that omission can lead to unintended disclosure of sensitive relationship, identity, or usage information when users run the tool or share its output.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The command description encourages generating narrative summaries from photos, including people, locations, scenes, and favorites, but does not warn that this output can expose sensitive metadata and inferred personal context. In a conversational agent setting, users may request broad recaps without realizing the tool can reveal private movement patterns, relationships, or habits, increasing privacy leakage risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Documenting an --output FILE option without any warning can lead users or agents to persist highly sensitive recap data to disk, where it may be retained, backed up, or exposed to other local users and tools. Because the recap may contain location history, named individuals, and behavioral summaries, silent file export materially increases the privacy impact of the feature.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/cleanup_executor.py (reported line 386)May include surrounding context.

python
continue

        try:
            result = subprocess.run(
                ["osascript", "-e", script],
                capture_output=True,
                text=True,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/doctor.py (reported line 286)May include surrounding context.

python
"Run doctor with --check-automation to test it",
        )
    try:
        result = subprocess.run(
            ["osascript", "-e", 'tell application "Photos" to get name'],
            capture_output=True,
            text=True,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code performs biometric-adjacent analysis on identified people by querying named face records and ranking their photos without any built-in user-facing notice, consent check, or privacy safeguard. Even though it appears intended as a photo-organization feature, processing identified individuals' face-quality data can expose sensitive personal information and create privacy/compliance risk if run on a user's library without clear disclosure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code analyzes potentially sensitive personal data from an Apple Photos library, including hidden items, favorites, people identities, date ranges, and location metadata. The visible description and examples do not warn the user that personal metadata will be read and summarized, and there is no confirmation prompt or other user-facing disclosure in this file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill processes exact photo GPS coordinates, clusters them into meaningful places/trips, and prints summaries including approximate place names and date ranges. Even though this is aligned with the skill’s purpose, handling and exposing travel history without an explicit privacy warning or precision-reduction control creates a real privacy risk if run on personal photo libraries.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill’s stated purpose is location/travel mapping, but it also queries face/person metadata and includes named people in per-location output. Combining identity data with location clusters materially increases privacy sensitivity by revealing who was present at specific places and times without that being necessary to the core feature.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code retrieves ZPERSON/ZDETECTEDFACE data and emits real names in the formatted summary without any in-file warning, consent check, or minimization. This exposes sensitive biometric/identity-derived metadata and links it to photo locations, which can leak social relationships, attendance, and movement patterns.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This script performs analysis over highly sensitive biometric and identity-linked data, including face detections, person names, co-occurrence relationships, favorites, and timelines, without any visible consent prompt, warning, or privacy guard in this file. In an agent-skill context, that increases the risk of silent overcollection or unexpected disclosure of social-graph and face-recognition data to a user or downstream consumer.

Content

No source excerpt is available for this finding.