Back to skill

Security audit

S2 Light Perception

Security checks for vulnerabilities and agentic risk

Overview

The skill openly targets smart-light discovery, but it directs active LAN scanning and arbitrary-IP reads without enough user control or destination limits.

Install only if you intend to let an agent actively probe your local network for smart lights. Run discovery only after explicit approval, restrict reads to trusted Hue/Wiz device IPs on your own LAN, and be aware that the packaged Python file appears malformed as submitted.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
light.py:72
Finding

Unrestricted User-Controlled Network Destination Enables SSRF-Like Requests

Content
View full analysis
dict: """ Real HTTP GET to Hue Bridge. 真实的 HTTP 请求调用 Hue Bridge。 """ # NOTE: Requires actual Hue username in production / 生产环境需填写真实 token url = f"http://{self.ip}/api/s2-agent-user/lights/1" try: req = urllib.request.Request(url) with urllib.request.urlopen(req, timeout=3.0) as response: data = json.loads(response.read().decode('utf-8')) if isinstance(data, dict) and "state" in data: return data return {"error": "Hue auth missing or light not found", "state": {"on": False}} except Exception as e: return {"error": str(e), "state": {"on": False}} def fetch_wiz_state(self) -> dict: """ Real UDP socket call to Wiz Bulb. 真实的 UDP Socket 直连调用 Wiz 灯泡。 """ try: sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.settimeout(3.0) msg = b'{"method":"getPilot","params":{}}' sock.sendto(msg, (self.ip, 38899)) data, _ = sock.recvfrom(1024) return json.loads(data.decode('utf-8')) except Exception as e: return {"error": f"Connection failed: {str(e)}", "result": {"state": False}} ``` The destination originates from command-line input: ```python parser.add_argument("--ip", help="Device IP / 设备 IP") parser.add_argument("--zone", help="Spatial Zone / 空间区域") parser.add_argument("--grid", help="2x2 Grid Coordinates / 2x2 网格坐标") parser.add_argument("--protocol", choices=["hue", "wiz", "mqtt"], default="hue") ``` It is then passed directly to the network adapter: ```python adapter = S2VoxelLight(args.ip, args.zone, args.grid) raw_state = {} if args.protocol == "hue": raw_state = ...[truncated 3148 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Lp1

High
Category
MCP Least Privilege
Confidence
98% confidence
Finding

The skill performs real network activity including UDP broadcast, SSDP multicast, direct UDP sockets, and HTTP requests, yet the finding indicates these capabilities are not covered by declared permissions. Undeclared network access is dangerous because it can surprise users, bypass expected consent or policy controls, and enable unauthorized LAN enumeration or interaction with local devices.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly advertises real UDP broadcast, SSDP multicast, and local HTTP/UDP calls against LAN devices, but it does not require a clear user-facing warning or explicit confirmation before initiating network activity. In an agent context, this can cause unauthorized network probing of the user's local environment, exposing device presence and metadata and potentially violating privacy or organizational policy.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The instructions tell the agent to execute python3 light.py --mode discover, which is an active network scan, without any embedded requirement to warn the user or verify consent at runtime. Because this is operational guidance to an AI agent, it materially increases the chance of unintended scanning of local networks and interaction with smart-home infrastructure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The discovery routine actively sends broadcast and multicast probes across the local network without a dedicated warning or confirmation step before scanning. This is risky because active LAN enumeration can expose the presence of local devices, trigger monitoring alerts, and violate user expectations or organizational network-use policies even if limited to smart-light discovery.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

Natural-language strings throughout the file are consistently forced into English/Chinese bilingual form, beginning with the header and continuing in user-facing messages. This imposes a locale/language format without any user opt-in or configuration mechanism.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest describes LAN UDP discovery and local API calls for Hue and Wiz devices. However, the CLI exposes a third protocol choice, "mqtt", while the code only implements Hue HTTP and Wiz UDP reads; this adds an unjustified capability surface in the public interface and does not match the stated purpose.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.