Back to skill

Security audit

xpai-camera-control

Security checks for vulnerabilities and agentic risk

Overview

This camera-control skill needs review because its preview server and automatic credential reuse can expose private feeds and passwords.

Prefer waiting for fixes that restrict and authenticate previews, verify camera identity before reusing passwords, and keep credentials out of chat results and persistent relay files. Use a trusted camera network and private storage directory. Understand cloud authorization, automatic session takeover, and persistent monitoring before enabling them; explicitly stop monitors when finished. The workflow coverage gap was independently reviewed, but external native cloud behavior remains unverified.

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/toolkit/stream.py
Finding

Camera preview API listens on all interfaces without authentication

Content
View full analysis

Impact

Unauthorized clients can view the relayed camera feed without possessing the camera credentials.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/toolkit/device_mgmt.py
Finding

Discovery can reassign cached camera credentials to an attacker-controlled endpoint

Content
View full analysis

Impact

The malicious endpoint can obtain the legitimate camera's cached credentials, enabling unauthorized access to the original camera.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
Findings (56)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

Cloud authorization itself is disclosed, but returning plaintext cloud-issued passwords in result messages unnecessarily exposes camera credentials to agent context, transcripts, and logging systems. The skill also documents loading saved credentials into tool results, supporting the credential-minimization concern; the reported MAC-derived host identifier and its transmission cannot be independently verified from this Markdown source.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

Most visible behavior matches the declared camera-control purpose. However, cloud_auth_request and cloud_auth_check delegate identifiers to explicitly cloud-oriented native operations, extending beyond the described LAN functionality. Exact network destinations and native implementation behavior cannot be verified from this chunk. Local interface enumeration, MAC/IP collection for discovery, native-library loading, and import-time diagnostics are supporting implementation details, not separate mismatches. Capabilities absent from this partial chunk are not treated as mismatches.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

Most behavior directly supports the declared streaming, preview, snapshot, and camera-control capabilities. However, toggle_recording implements a substantial recording capability not disclosed in the description: it launches FFmpeg to save audio/video, maintains recording state on disk, and manages recording processes across calls or application restarts. Retaining footage as recordings is distinct from live streaming and individual snapshots. Subprocess execution, relay configuration, and codec changes otherwise serve the declared features and are not separate mismatches.

Content

No source excerpt is available for this finding.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
If PTZ detailed sequences or degrees mode are needed → [WORKFLOW.md — Phase 4](references/WORKFLOW.md#phase-4--ptz-control-detailed-tool-calls).

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
ble (cloud auth internals, direct_connect) | [references/WORKFLOW.md — Phase 2](references/WORKFLOW.md#phase-2--connect--authorize-detailed-tool-calls) |

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · references/MCP_TOOLS_API.md (reported line 52)May include surrounding context.

md
### `register_camera`

Persist camera credentials to `config.yaml`. Renaming is supported: when a new name is passed but the IP or SN matches an existing entry, the old name is replaced automatically. Usually called internally by `connect_device` / `search_devices`.

**Parameters**:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · references/MCP_TOOLS_API.md (reported line 100)May include surrounding context.

md
| `success`              | bool               | Whether the search succeeded           |
| `devices`              | DiscoveredDevice[] | List of discovered devices             |
| `device_count`         | int                | Number of devices (additional field)   |
| `_display_instruction` | string             | Display instruction (additional field) |
| `error_message`        | string             | Failure reason                         |

**DiscoveredDevice fields**:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% 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 · scripts/toolkit/device_mgmt.py (reported line 215)May include surrounding context.

python
_OBF_PREFIX + base64.b64encode(bytes(b ^ _XOR_KEY for b in raw)).decode("ascii")

def _get_local_ip() -> str:
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    try:
        s.connect(("8.8.8.8", 80))
        ip = s.getsockname()[0]
    except Exception:
        ip = "192.168.1.100"
    finally:
        s.close()
    return ip

def _get_local_mac() -> str:
    import platform
    try:
        if platform.system() == "Windows":
            import re
            import subprocess
            out = subprocess.check_output("getmac", shell=True).decode("gbk", "ignore")
            m = re.search(r"([0-9A-Fa-f]{2}[:-]){5}[0-9A-Fa-f]{2}", out)
            if m:
                return m.group(0).replace("-", ":").upper()
        else:
            return ":".join(f"{b:02X}" for b in uuid.getnode().to_bytes(6, "big"))
    except Exception:
        pass
    return "00:00:00:00:00:00"

def generate_claw_id() -> str:
    mac = _get_local_mac().replace(":", "").upper()
    now = datetime.now()
    ts = now.strfti

WebRTC relay starts a network-accessible API without warning that it is not restricted to localhost.

High
Category
Output Handling
Confidence
99% confidence
Finding

The generated API listener uses ':port', exposing the relay on available network interfaces rather than restricting it to loopback, while the returned localhost URL suggests local-only access. No authentication or access restriction is configured here, potentially exposing private camera streams and relay management functionality to reachable network clients.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · references/MCP_TOOLS_API.md (reported line 89)May include surrounding context.

md
**Parameters**:

| Parameter | Type   | Required | Default | Description                                                                                                                                   |
|-----------|--------|:--:|---------|------------------------------------------------------------------------------------------------------------------------------------------------|
| `timeout` | number |    | `15.0`  | Overall time limit (seconds). Returns early once discovery goes quiet: short re-probe rounds, ending after 2 consecutive rounds with no new devices — usually well before the limit |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

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

md
**Returns**: `ConnectResult`

| Field             | Type   | Description                                                                                              |
|------------------|--------|----------------------------------------------------------------------------------------------------------|
| `success`        | bool   | Whether the connection succeeded                                                                        |
| `status`         | string | `"connected"` / `"needs_password"` / `"no_sn"` / `"failed"` / `"auth_rejected"` / `"cloud_pwd_failed"` |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · references/MCP_TOOLS_API.md (reported line 365)May include surrounding context.

md
**CameraEvent fields**:

| Field             | Type     | Description                                                                                              |
|------------------|----------|----------------------------------------------------------------------------------------------------------|
| `schema_version` | string   | `"1.0"`                                                                                                  |
| `event_id`       | string   | Unique event ID                                                                                          |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · references/MCP_TOOLS_API.md (reported line 155)May include surrounding context.

md
| `needs_password` | bool   | Whether the user needs to provide a password                                                            |
| `onvif_port`     | int    | Verified ONVIF port (0 = unverified)                                                                    |
| `protocol_type`  | string | Device protocol class `"S"`/`"J"`/`"O"` (empty if unresolved); for O-class, explain the degraded capability set to the user |
| `error_message`  | string | Failure reason                                                                                          |

**status handling**:
- `connected` → connected, ready to operate

Cached-credential recovery explicitly skips user notice before automatic cloud re-authorization.

Medium
Category
Output Handling
Confidence
90% confidence
Finding

The recovery workflow explicitly suppresses notice before initiating an external cloud-authorization request, even though normal cloud authorization requires advance notice. This creates an undisclosed network and authorization side effect during an apparently local reconnection; approval in the bound app still limits unauthorized credential issuance.

Content

No source excerpt is available for this finding.

Live-preview workflow instructs the agent to expose credentials embedded in the complete RTSP URL.

Medium
Category
Data Exfiltration
Confidence
98% confidence
Finding

The preview instructions require copying a credential-bearing RTSP URL into the conversation, exposing reusable camera credentials to chat retention, exports, and anyone with transcript access. Because these credentials can permit viewing private camera feeds and potentially other camera operations, a warning against public sharing does not adequately mitigate the exposure.

Content

No source excerpt is available for this finding.

The connection safety description claims credentials are local-only despite an automatic cloud-authorization workflow.

Medium
Category
Output Handling
Confidence
89% confidence
Finding

Labeling connection safety as 'None' because credentials are 'local-only' obscures the documented automatic cloud POST and polling paths. This can cause the agent to initiate external authorization without an appropriate disclosure, although the supplied text does not establish that existing local passwords are uploaded.

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

python
import subprocess
    try:
        if sys.platform == "win32":
            out = subprocess.check_output(
                ["netstat", "-ano", "-p", "TCP"],
                timeout=3, stderr=subprocess.DEVNULL, 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/mcp_server.py (reported line 599)May include surrounding context.

python
except ValueError:
                            pass
        elif sys.platform == "darwin":
            out = subprocess.check_output(
                ["lsof", "-i", f":{port}", "-sTCP:LISTEN", "-Fn"],
                timeout=3, stderr=subprocess.DEVNULL, 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/mcp_server.py (reported line 612)May include surrounding context.

python
except ValueError:
                        pass
        else:
            out = subprocess.check_output(
                ["ss", "-tlnp", f"sport = :{port}"],
                timeout=3, stderr=subprocess.DEVNULL, 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/mcp_server.py (reported line 634)May include surrounding context.

python
"powershell", "-NoProfile", "-Command",
                f"Get-CimInstance Win32_Process -Filter 'ProcessId={pid}' | Select -Expand CommandLine",
            ]
            out = subprocess.check_output(cmd, timeout=5, stderr=subprocess.DEVNULL, text=True)
            return out.strip()
        elif sys.platform == "darwin":
            out = subprocess.check_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 · scripts/mcp_server.py (reported line 637)May include surrounding context.

python
out = subprocess.check_output(cmd, timeout=5, stderr=subprocess.DEVNULL, text=True)
            return out.strip()
        elif sys.platform == "darwin":
            out = subprocess.check_output(
                ["ps", "-p", str(pid), "-o", "command="],
                timeout=3, stderr=subprocess.DEVNULL, text=True,
            )

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
94% confidence
Finding

Although this argument-list invocation is not command injection, its caller automatically force-kills a matching server when the lock is occupied, without establishing that the server is stale. On Windows, /T also terminates descendants, potentially interrupting camera monitoring, recordings, and other active work; this is the same underlying issue as SDI-2.

Content

Scanner excerpt · scripts/mcp_server.py (reported line 667)May include surrounding context.

python
import subprocess
    try:
        if sys.platform == "win32":
            subprocess.check_call(
                ["taskkill", "/F", "/T", "/PID", str(pid)],
                timeout=5, stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
            )

Camera operations can forcibly terminate an existing host-side MCP server without checking whether it is active or obtaining confirmation.

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

A routine camera operation can enter lock recovery and forcibly terminate an existing matching MCP server, even when it is healthy and actively serving another session. The command-line identity check limits the targets but does not establish staleness or permission to disrupt ongoing recording and alarm monitoring.

Content

No source excerpt is available for this finding.

scripts/toolkit/camera_proto.py exposes cloud authorization operations beyond the stated LAN-camera scope.

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

The manifest describes discovering, connecting to, and controlling LAN cameras, but L366-L371 additionally implement cloud authorization request and status-check wrappers using device serial numbers and claw IDs. These delegate to native cloud-authentication APIs rather than the local camera-control APIs; the supplied manifest does not disclose this cloud authorization workflow.

Content

No source excerpt is available for this finding.