Back to skill

Security audit

imac-cam

Security checks for vulnerabilities and agentic risk

Overview

This skill can capture webcam imagery and expose it, along with the shared temporary folder, over an unauthenticated network server.

Review carefully before installing. This skill should not be used on a shared or networked machine unless the HTTP server is removed or restricted to a private directory, localhost-only access, authentication, explicit user confirmation, and automatic shutdown.

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
capture.py:125
Finding

Unauthenticated Network Exposure of Camera Images and the Shared Temporary Directory

Content
View full analysis
/dev/null 2>&1; then cd /tmp && python3 -m http.server 8765 & sleep 1 fi echo "HTTP 服务器已启动: http://192.168.3.210:8765" ``` ### Technical Analysis The Python standard-library HTTP server binds to all available network interfaces by default when no `--bind` argument is supplied. The code changes its working directory to `/tmp` before launching the server, making the entire shared temporary directory the HTTP document root. The server provides no authentication, authorization, transport encryption, randomized access token, or client-address restriction. Python's default HTTP handler also generates directory listings where no index file exists. Consequently, a client capable of reaching TCP port 8765 can enumerate and download readable files from `/tmp`, including the generated `/tmp/cam_capture.png`. The exposure is broader than the Skill's documented requirement to serve one camera image. `/tmp` is a shared location that can contain temporary information created by unrelated applications and users. The HTTP server remains available after capture because the process handle is not retained and the server is not terminated after the image is retrieved. ### Attack Path 1. A user invokes the camera-capture Skill. 2. The Skill captures the Photo Booth window and wr ...[truncated 1341 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
capture.py:120
Finding

Port-Occupancy Check Trusts an Unverified Local Service

Content
View full analysis
/dev/null 2>&1; then cd /tmp && python3 -m http.server 8765 & sleep 1 fi ``` ### Technical Analysis The Python code treats any successful connection to localhost port 8765 as proof that the expected camera HTTP server is already running. It does not verify the listener's process owner, executable, document root, protocol behavior, or association with the current invocation. The shell script has the same trust flaw: `lsof -i :8765` establishes only that a listener exists. It does not establish that the listener is the intended Python server. A local process that binds port 8765 before the Skill runs can therefore prevent the legitimate server from starting. The Skill subsequently prints a trusted-looking camera URL even though the service at that URL may be unrelated or attacker-controlled. Because the printed address can use a LAN-facing IP, an attacker-controlled listener bound to all interfaces could also serve spoofed content to a user accessing the announced URL. ### Attack Path 1. An attacker with the ability to run an unprivileged local process binds TCP port 8765 before the Skill starts. 2. The user invokes the camera-capture Skill. 3. `connect_ex()` succeeds, or `lsof` reports the occupied port. 4. The Skill skips creati ...[truncated 1062 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Opening a listener on port 8765 and serving files from /tmp goes beyond simple camera capture and can expose sensitive files or images to other users on the network. The mismatch between description and actual network-serving behavior is especially dangerous because users may invoke it without understanding that a network service will be started.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Opening a listener on port 8765 and serving files from /tmp goes beyond simple camera capture and can expose sensitive files or images to other users on the network. The mismatch between description and actual network-serving behavior is especially dangerous because users may invoke it without understanding that a network service will be started.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill description does not clearly warn users that invoking it captures camera imagery and briefly exposes that image through an HTTP server. Lack of explicit disclosure undermines informed consent for a highly privacy-sensitive operation and makes accidental overexposure more likely.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill claims to capture/view the iMac camera but also spins up a web server and exposes the resulting image via an IP-based URL. That materially changes the trust model from local capture to network publication of sensitive visual data and can leak images to anyone able to reach the host.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Adding network-serving capability is unrelated to simply opening or viewing the camera and introduces unnecessary remote exposure. In the context of a webcam skill, this is especially dangerous because it can leak highly sensitive image data beyond the local machine.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill claims to capture iMac camera output, but the script instead launches a generic Python HTTP server rooted at /tmp. This creates a capability unrelated to the declared purpose and strongly suggests deceptive behavior, since it exposes arbitrary temporary files over the network rather than interacting with Photo Booth or the camera.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Serving /tmp over HTTP can expose sensitive transient data, tokens, downloads, screenshots, logs, or application artifacts to other systems on the network. In the context of a camera-viewing skill, this capability is unjustified and increases risk because users would not reasonably expect broad file exposure when asking to view the camera.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
79% confidence
Finding

The skill declares no explicit tool scope even though its described behavior requires shell execution and file access. Missing scope boundaries increases the chance of unintended or overly broad execution, and makes review and enforcement of least privilege harder for a camera-related skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrase "监控" is broad and likely to appear in normal conversation, increasing the risk of accidental invocation. Because this skill captures camera imagery, unintended activation has direct privacy implications and may start sensitive actions without clear user intent.

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 · capture.py (reported line 15)May include surrounding context.

python
def is_photo_booth_running():
    """检查 Photo Booth 是否正在运行"""
    result = subprocess.run(
        ['osascript', '-e', 'tell application "System Events" to name of processes whose background only is false'],
        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 · capture.py (reported line 43)May include surrounding context.

python
set h to item 2 of winSize
return x & "," & y & "," & w & "," & h
'''
    result = subprocess.run(['osascript', '-e', script], capture_output=True, text=True)
    output = result.stdout.strip()
    print(f"Raw output: {output}")

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 · capture.py (reported line 80)May include surrounding context.

python
# 确保 Photo Booth 启动
    if not is_photo_booth_running():
        print("启动 Photo Booth...")
        subprocess.run(['osascript', '-e', 'tell application "Photo Booth" to activate'], capture_output=True)
        time.sleep(2)
    
    for attempt in range(max_retries):

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 · capture.py (reported line 93)May include surrounding context.

python
continue
        
        # 确保窗口在前
        subprocess.run([
            'osascript', '-e',
            '''tell application "System Events"
                set frontmost of process "Photo Booth" to 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 · capture.py (reported line 102)May include surrounding context.

python
time.sleep(0.2)
        
        # 截取
        subprocess.run([
            '/usr/sbin/screencapture', 
            '-x', 
            '-R' + rect,

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill collects network interface information despite its advertised purpose being camera capture. In context, this supports constructing a remotely accessible URL and is therefore part of an unnecessary data exposure path rather than harmless local functionality.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
83% confidence
Finding

The code enumerates local network interface information to discover an IP address, which is then used to publish a URL for accessing the captured camera image. In the context of a camera-capture skill, gathering network details expands the attack surface and facilitates unintended exposure of sensitive camera output.

Content

Scanner excerpt · capture.py (reported line 122)May include surrounding context.

python
def get_ip():
    """获取本机 IP"""
    result = subprocess.run(['/usr/sbin/scutil', '--nwi'], capture_output=True, text=True)
    for line in result.stdout.split('\n'):
        if 'address' in line and '2408' not in line:
            parts = line.strip().split()

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code silently starts a local HTTP server and publishes the screenshot path without a clear user-facing warning that camera output is now network-accessible. Users expecting a local capture may unknowingly expose private imagery to others on the network.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
98% confidence
Finding

This code starts an HTTP server in /tmp and serves the captured camera image over the network without authentication, access control, or prominent user consent. That turns a local camera snapshot into remotely retrievable content, creating a substantial confidentiality risk on the local network.

Content

Scanner excerpt · capture.py (reported line 139)May include surrounding context.

python
sock.close()
        if result != 0:
            os.chdir('/tmp')
            subprocess.Popen(['python3', '-m', 'http.server', '8765'], 
                           stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
            time.sleep(1)
    except:

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 · capture.py (reported line 151)May include surrounding context.

python
# 截图完成后关闭 Photo Booth
        print("关闭 Photo Booth...")
        subprocess.run(['osascript', '-e', 'tell application "Photo Booth" to quit'], capture_output=True)
    else:
        print("捕获失败")

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file's docstrings and printed status messages are written in Chinese throughout, which imposes a specific language on users. There is no indication that the skill offers a language choice or that the Chinese-only behavior is required for a justified region-specific use case.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script contains Chinese-only comments and a Chinese user-facing status message (HTTP 服务器已启动), which imposes a specific language without any user opt-in or documented regional justification. This matches the policy category for language or locale constraints in natural-language content.

Content

No source excerpt is available for this finding.