Back to skill

Security audit

Photo Capture Skill

Security checks for vulnerabilities and agentic risk

Overview

This webcam skill is mostly purpose-aligned, but its macOS fallback can capture arbitrary windows or the whole screen and has unsafe AppleScript argument handling, so it should be reviewed before installation.

Install only if you are comfortable with a skill that can access your camera and, on macOS fallback, may require Screen Recording, Accessibility, and Automation permissions. Prefer the ffmpeg webcam path, avoid using the macOS screenshot fallback unless you explicitly need it, and do not pass untrusted app names or delay values to the fallback scripts.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/capture_via_app.py:27
Finding

AppleScript Injection Through the Python macOS Fallback

Content
View full analysis
None: script = f''' tell application "System Events" tell process "{app_name}" set frontmost to true tell application "Finder" set desktopBounds to bounds of window of desktop end tell set screenW to item 3 of desktopBounds set screenH to item 4 of desktopBounds try set position of front window to {{60, 60}} set size of front window to {{screenW - 120, screenH - 140}} end try end tell end tell ''' run_applescript(script) ``` The same unsafe interpolation is used when obtaining window bounds: ```python def get_window_bounds(app_name: str) -> str: script = f''' tell application "System Events" tell process "{app_name}" set frontmost to true set winPos to position of front window set winSize to size of front window set x1 to item 1 of winPos set y1 to item 2 of winPos set w1 to item 1 of winSize set h1 to item 2 of winSize return (x1 as text) & "," & (y1 as text) & "," & (w1 as text) & "," & (h1 as text) end tell end tell ''' return run_applescript(script) ``` ### Technical Analysis The `--app` command-line argument is stored in `app_name` and inserted directly into AppleScript source through a Python formatted string. It is not escaped or validated before being placed inside the quoted `tell process` expression. A value containing AppleScript string delimiters and additional statements can alter the source code subsequently passed to: ```python subprocess.run( ["/usr/bin/osascript", "-e", script], ... ) ``` Using an argument-list subprocess p ...[truncated 1736 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/capture_via_app.sh:87
Finding

AppleScript Injection Through Shell Fallback Arguments

Content
View full analysis
Remediation
View remediation
&2 exit 2 ;; esac case "$post_layout_delay" in ''|*[!0-9.]*) echo "--layout-delay must be a non-negative number" >&2 exit 2 ;; esac /usr/bin/osascript - "$app_name" "$layout_mode" \ "$activate_delay" "$post_layout_delay" <<'APPLESCRIPT' on run argv set appName to item 1 of argv set layoutMode to item 2 of argv set activateDelay to (item 3 of argv) as real set layoutDelay to (item 4 of argv) as real tell application appName to activate delay activateDelay -- Remaining static operations end run APPLESCRIPT ``` The numeric validation should ideally be implemented with a stricter parser than the abbreviated shell example, including rejection of multiple decimal points and non-finite values. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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 (24)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This duplicate mismatch finding points to the same core issue: the skill claims a cross-platform direct-camera workflow, yet also includes a macOS screenshot-based fallback that depends on UI automation and screen capture permissions. Because screen/window capture can collect data beyond the intended webcam image, the discrepancy materially increases privacy risk and can mislead reviewers or users about what the skill actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This duplicate mismatch finding points to the same core issue: the skill claims a cross-platform direct-camera workflow, yet also includes a macOS screenshot-based fallback that depends on UI automation and screen capture permissions. Because screen/window capture can collect data beyond the intended webcam image, the discrepancy materially increases privacy risk and can mislead reviewers or users about what the skill actually does.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill advertises fresh webcam capture, but this script instead screenshots an application window or even the entire display. That mismatch creates a data-exposure risk because the output may contain unrelated on-screen content, notifications, documents, or other sensitive information rather than only camera pixels.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Supporting full-screen capture is unjustified for a photo-capture skill and materially expands the data that can be collected beyond the user's webcam view. If triggered, it can capture passwords, messages, confidential documents, or other applications visible on the screen, making the behavior privacy-invasive and inconsistent with least privilege.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The --app parameter allows the caller to target any application name, not just a camera application. In the context of a photo-capture skill, this creates an unnecessary capability to activate and capture arbitrary app windows, which could expose emails, chats, documents, credentials, or other sensitive on-screen information.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The --capture option permits either window or full-screen screenshots, which is materially broader than the advertised capability of taking a fresh webcam image. An agent invoking this script could capture unrelated sensitive content from the user's desktop or other applications, turning a camera skill into a general screenshot primitive.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README promotes AI-driven webcam capture and saving photos to disk, but it does not prominently warn that this is privacy-sensitive, may capture bystanders or sensitive surroundings, and persists images locally. In an agent context, missing consent and retention warnings increase the risk of covert or poorly informed collection of personal imagery.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 38)May include surrounding context.

md
|----------|---------|
| **macOS** | `brew install ffmpeg` |
| **Windows** | `winget install ffmpeg` or download from [ffmpeg.org](https://ffmpeg.org) |
| **Linux (Debian/Ubuntu)** | `sudo apt install ffmpeg` |
| **Linux (Fedora)** | `sudo dnf install ffmpeg` |
| **Linux (Arch)** | `sudo pacman -S ffmpeg` |

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 39)May include surrounding context.

md
|----------|---------|
| **macOS** | `brew install ffmpeg` |
| **Windows** | `winget install ffmpeg` or download from [ffmpeg.org](https://ffmpeg.org) |
| **Linux (Debian/Ubuntu)** | `sudo apt install ffmpeg` |
| **Linux (Fedora)** | `sudo dnf install ffmpeg` |
| **Linux (Arch)** | `sudo pacman -S ffmpeg` |

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
|----------|---------|
| **macOS** | `brew install ffmpeg` |
| **Windows** | `winget install ffmpeg` or download from [ffmpeg.org](https://ffmpeg.org) |
| **Linux (Debian/Ubuntu)** | `sudo apt install ffmpeg` |
| **Linux (Fedora)** | `sudo dnf install ffmpeg` |
| **Linux (Arch)** | `sudo pacman -S ffmpeg` |

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 185)May include surrounding context.

md
|----------|---------|
| **macOS** | `brew install ffmpeg` |
| **Windows** | `winget install ffmpeg` or download from [ffmpeg.org](https://ffmpeg.org) |
| **Linux (Debian/Ubuntu)** | `sudo apt install ffmpeg` |
| **Linux (Fedora)** | `sudo dnf install ffmpeg` |
| **Linux (Arch)** | `sudo pacman -S ffmpeg` |

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 186)May include surrounding context.

md
|----------|---------|
| **macOS** | `brew install ffmpeg` |
| **Windows** | `winget install ffmpeg` or download from [ffmpeg.org](https://ffmpeg.org) |
| **Linux (Debian/Ubuntu)** | `sudo apt install ffmpeg` |
| **Linux (Fedora)** | `sudo dnf install ffmpeg` |
| **Linux (Arch)** | `sudo pacman -S ffmpeg` |

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 187)May include surrounding context.

md
|----------|---------|
| **macOS** | `brew install ffmpeg` |
| **Windows** | `winget install ffmpeg` or download from [ffmpeg.org](https://ffmpeg.org) |
| **Linux (Debian/Ubuntu)** | `sudo apt install ffmpeg` |
| **Linux (Fedora)** | `sudo dnf install ffmpeg` |
| **Linux (Arch)** | `sudo pacman -S ffmpeg` |

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill invokes shell commands and reads local files but does not declare any tool scope or permission boundaries in the skill manifest. That omission increases the chance the agent can execute commands or access files without explicit review, which is risky for a camera-capture skill because it touches sensitive hardware and writes artifacts to disk.

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/capture_via_app.py (reported line 11)May include surrounding context.

python
def run_applescript(script: str, timeout: int = 15) -> str:
    proc = subprocess.run(
        ["/usr/bin/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/capture_via_app.py (reported line 23)May include surrounding context.

python
def activate_app(app_name: str) -> None:
    subprocess.run(["/usr/bin/open", "-a", app_name], check=True)


def set_large_window(app_name: str) -> None:

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script manipulates UI state through AppleScript, System Events, and synthetic keystrokes despite the skill manifest explicitly preferring approaches that avoid accessibility and UI automation permissions. This increases privilege requirements and broadens the attack surface, enabling interactions with desktop UI that are unrelated to the narrow goal of taking a webcam photo.

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/capture_via_app.py (reported line 70)May include surrounding context.

python
def screenshot_window(bounds: str, output_path: str) -> None:
    subprocess.run(["/usr/sbin/screencapture", "-x", f"-R{bounds}", output_path], check=True)


def screenshot_screen(output_path: str) -> None:

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/capture_via_app.py (reported line 74)May include surrounding context.

python
def screenshot_screen(output_path: str) -> None:
    subprocess.run(["/usr/sbin/screencapture", "-x", output_path], check=True)


def parse_args() -> argparse.Namespace:

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script description explicitly states it will save a screenshot, which contradicts the documented purpose of capturing a fresh webcam image. This kind of intent mismatch is dangerous in an agent skill because operators and users may grant permissions or invoke the skill under false assumptions about what data will actually be collected.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This script explicitly implements an app-driven screenshot workflow despite the skill description stating a preference for direct webcam capture without screen-recording, accessibility, or UI automation dependencies. That mismatch broadens the data-access surface from a fresh camera frame to whatever is displayed in the target app or screen, increasing privacy risk and making accidental over-capture more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

When capture_mode is set to screen, the script silently saves a screenshot of the entire display with no user-facing warning or confirmation. In a skill presented as taking a webcam photo, this hidden behavior is especially dangerous because users may not realize that all visible desktop content—not just the camera view—can be collected.

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/capture_webcam.py (reported line 29)May include surrounding context.

python
def run(cmd: List[str], check: bool = True) -> subprocess.CompletedProcess:
    """Run a command and capture its output."""
    return subprocess.run(cmd, capture_output=True, text=True, check=check)


def require_ffmpeg() -> str:

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
2% confidence
Finding

The file offers both English and Chinese sections and does not require one language without user choice. This does not meet the threshold for a natural-language policy violation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.