T09 · Insecure Skill Coding Practices
- Location
scripts/web_preview.py:118- Finding
Unauthenticated Live Webcam Exposure on All Network Interfaces
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a real webcam-monitoring package, but it exposes a live webcam server on all network interfaces without authentication and recommends overly broad camera-device permissions.
Install only after reviewing the webcam exposure risks. Change the preview server to bind to 127.0.0.1 or add authentication before running it, do not use chmod 666 for /dev/video0, and be careful with stored snapshots, automatic deletion, and any person-identification memory entries.
scripts/web_preview.py:118Unauthenticated Live Webcam Exposure on All Network Interfaces
SKILL.md:114World-Readable and World-Writable Webcam Device Permission Recommendation
The code clearly fits part of the description: it uses a webcam, detects motion, saves snapshots, and logs monitoring events. However, the declared purpose is significantly broader and includes WSL2 with USB/IP passthrough support, monitoring camera snapshots, auto-analyzing images with AI, and managing webcam-based security monitoring for specific camera setups. None of those broader or specialized capabilities appear in this code chunk. The actual behavior is a straightforward headless OpenCV motion detector operating on local camera device 0 with file logging and snapshot capture. Because key declared capabilities are absent and the description materially overstates what this code does, this should be flagged as a mismatch.
The supplied code is clearly webcam-related, so it partially overlaps with the declared domain. However, the description emphasizes a motion detection and monitoring system for WSL2 with USB/IP passthrough, including automated image analysis and security/activity monitoring workflows. This code does not implement motion detection, automated monitoring logic, AI analysis, or any USB/IP/WSL2 configuration behavior. Instead, it provides a simple local web preview server with live streaming and a manual snapshot button. That is a materially narrower and different primary purpose than the declared description.
The command sudo chmod 666 /dev/video0 is an unsafe parameter recommendation because it applies an overly broad permission mode to a sensitive device. This weakens local security controls and can be abused by other local users or processes to access or disrupt the camera.
sudo chmod 666 /dev/video0
Exposing live camera data on all network interfaces without warning or access controls is dangerous because webcam imagery is highly sensitive and can reveal occupants, activities, and surroundings. In the context of a monitoring skill, this is more dangerous than a generic HTTP service because the data is inherently privacy-sensitive and the /snapshot endpoint can also persist images to disk remotely.
The skill describes behaviors that involve writing files and exposing a web service, but it does not declare any explicit tool scope or permissions boundary. This increases the chance that an agent executes file-write or network-capable actions without clear user visibility or least-privilege constraints.
The skill advertises automatic deletion of snapshots without a clear warning that data will be destructively removed on a schedule. Users may unintentionally lose evidence or important records, especially in a security-monitoring context where snapshots may be needed later.
Setting /dev/video0 to mode 666 makes the webcam world-readable and world-writable, allowing any local process or user to access the camera device. In a monitoring skill, this is especially dangerous because it can enable unauthorized camera use, privacy compromise, or interference with capture operations.
sudo chmod 666 /dev/video0
Setting /dev/video0 to mode 666 makes the webcam world-readable and world-writable, allowing any local process or user to access the camera device. In a monitoring skill, this is especially dangerous because it can enable unauthorized camera use, privacy compromise, or interference with capture operations.
sudo chmod 666 /dev/video0
The skill encourages collecting, storing, and analyzing identifiable webcam images and personal traits without an explicit privacy warning, consent guidance, or retention safeguards. This can lead to privacy violations, unauthorized surveillance, and mishandling of sensitive biometric or identifying data.
The instructions explicitly tell users to store detailed person-identification data such as name, appearance, clothing, jewelry, and environment for AI analysis of webcam snapshots. In context, this is more dangerous because the skill is for persistent camera monitoring, making it easy to build sensitive profiles of identifiable individuals and enabling intrusive surveillance.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
#!/usr/bin/env python3.10
"""
Snapshot Watcher with Auto-Cleanup
Watches for new snapshots AND automatically deletes old ones
"""
import os
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
#!/usr/bin/env python3.10
"""
Snapshot Watcher with Auto-Cleanup
Watches for new snapshots AND automatically deletes old ones
"""
import os
This code deletes snapshot and queue files via unlink() on a timer, which is a destructive operation. Although the file has a top-level docstring and logs that cleanup occurs, there is no confirmation step or stronger user-facing warning before irreversible deletion begins.
This code saves camera images into a persistent directory under the user's home folder, which affects user data/privacy. Although there is a runtime print after saving, there is no prior disclosure in the file's docstring, comments, or UI text warning that snapshots will be stored locally.
The server binds to 0.0.0.0, making the live webcam feed reachable from other hosts on the network rather than only the local machine. In a webcam-monitoring skill, this materially increases exposure because anyone with network access to the port can view sensitive camera data and trigger snapshot capture without authentication.
The docstring claims the preview is served at localhost:8080, but the code actually listens on 0.0.0.0:8081. This mismatch can mislead users into believing the feed is local-only when it is in fact exposed on all interfaces, increasing the chance of accidental data exposure.