Back to skill

Security audit

Unifi

Security checks for vulnerabilities and agentic risk

Overview

This UniFi monitoring skill appears read-only, but it asks for high-impact admin credentials, disables TLS certificate checks, and silently saves sensitive network inventory locally.

Install only if you are comfortable giving this skill access to sensitive UniFi administrator credentials and detailed network topology. Use a least-privilege read-only account if possible, protect the credential file with restrictive permissions, avoid running it on untrusted networks until TLS verification is fixed, and delete or disable the dashboard inventory/debug files if you do not want network data retained locally.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/unifi-api.sh:33
Finding

TLS Certificate Verification Disabled for Authentication and API Requests

Content
View full analysis
/dev/null ``` ```bash curl -sk -b "$UNIFI_COOKIE_FILE" "$full_url" ``` ### Technical Analysis Both `curl` commands use `-k`, which is equivalent to `--insecure`. This disables validation of the HTTPS certificate presented by the UniFi gateway. The authentication request sends the configured administrator username and password in its JSON body. Subsequent API requests transmit an authenticated session cookie. Although HTTPS encryption is requested, disabling certificate verification prevents the client from confirming that it is communicating with the intended gateway. An attacker capable of intercepting or redirecting local network traffic could present an attacker-controlled certificate. Because `curl -k` accepts that certificate, the attacker could terminate the TLS connection, read the authentication payload, capture the session cookie, and relay requests to the legitimate gateway to avoid obvious failures. ### Attack Path 1. The victim configures a legitimate UniFi gateway URL and invokes one of the Skill scripts. 2. An attacker obtains a suitable local interception position through a compromised access point, ARP spoofing, DNS poisoning, routing compromise, or another network redirection technique. 3. The attacker redirects the configured gateway connection to an attacker-controlled TLS endpoint. 4. The attacker presents an untrusted or forged certificate. 5. The script accepts the certificate because `curl` is invoked with `-k`. 6. The login request exposes the UniFi username and password to the attacker. 7. Authenticated API requests can additionally expose a reusable session cookie and sensitive network ...[truncated 676 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
README.md:19
Finding

Overprivileged Administrator Credentials Stored Without Mandatory File-Permission Hardening

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/dashboard.sh:34
Finding

Dashboard Silently Persists Sensitive Network Inventory and Debug Data

Content
View full analysis
dashboard_debug_dump.json 2>/dev/null ``` The generated dashboard is written persistently through `tee`: ```bash # Generate dashboard output and save to file { ``` ```bash } | tee "$OUTPUT_FILE" ``` ### Technical Analysis A dashboard request is presented as a monitoring and reporting operation, but the implementation has two persistent filesystem side effects: 1. It writes a formatted inventory to `$HOME/clawd/memory/bank/unifi-inventory.md`. 2. It writes raw API responses to `dashboard_debug_dump.json` in the caller's current directory. The raw dump contains health information, device inventory, connected clients, network definitions, and WLAN configuration. The formatted inventory additionally includes IP addresses, MAC addresses, routes, firewall rules, port-forwarding details, alarms, and other operational information collected by the script. Neither output is protected with an explicit restrictive `umask` or file mode. The current-directory debug file can also be unintentio ...[truncated 1765 chars]
Remediation
View remediation
`. - Clearly document what information is retained, where it is stored, and how users can delete it. - Apply `umask 077` before creating any file containing network data. - Create output files with mode `600` and parent directories with mode `700`. - Reject symbolic-link output targets and avoid predictable filenames in shared directories. - If temporary raw data is required, use `mktemp`, register an exit trap, and delete the file after processing. - Avoid writing operational inventory into an Agent memory directory unless persistent memory is an explicit, user-approved feature. - Add retention controls and remove obsolete inventories automatically when persistence is enabled. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (18)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented behavior claims read-only monitoring of operational status, but the static finding indicates the skill also retrieves sensitive configuration data such as firewall rules, WLAN/network definitions, routing, and port forwards, and persists inventory/debug data to local files. That mismatch is dangerous because users and policy systems may authorize the skill under a narrower trust model than its actual data access and retention behavior, leading to unintended exposure of network architecture and security controls.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
## Setup

### 1. Create a Local Admin Account

1. Open your UniFi OS console (e.g., `https://10.1.0.1`)
2. Go to **OS Settings → Admins & Users**

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README tells users to store a local admin username and password in a plaintext JSON file or environment variables without warning about the sensitivity of those secrets. That creates a real risk of credential disclosure through weak file permissions, backups, shell history, process listings, or accidental sharing, especially because the account is an admin for network infrastructure.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

The README normalizes use of curl -k/skipping TLS certificate verification for a tool that authenticates with admin credentials to a network gateway. Disabling certificate validation makes man-in-the-middle interception of the UniFi session and credentials materially easier on any untrusted or compromised local network path.

Content

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

md
→ Wrong username/password. Must be a **local** admin, not Ubiquiti cloud account.

**SSL certificate error**  
→ UniFi uses self-signed certs. The scripts use `-k` to skip verification.

**Empty data or "Invalid site"**  
→ Most setups use `default`. Check your site name in the UniFi Network URL.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill invokes shell scripts and makes network calls but does not declare any explicit tool scope or permission boundaries in the skill manifest. That increases the blast radius because an agent may execute shell/network actions without clear user-visible constraints or policy enforcement, especially in a skill that also handles stored credentials and accesses sensitive network telemetry.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

The skill instructs users to store a long-lived UniFi admin username and password in a persistent local JSON file under the user's home directory. Persistent plaintext credential storage creates credential theft risk from local compromise, overly broad file permissions, backups, logs, or other tools reading the file, and the impact is amplified because these credentials grant access to sensitive network management data.

Content

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

Setup

Create the credentials file: ~/.clawdbot/credentials/unifi/config.json

json
{

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file documents read-only calls such as admins, clients, devices, firewall rules, WLANs, RADIUS accounts, and DPI statistics, all of which can reveal sensitive information about a user's network and connected devices. Although the file emphasizes read-only access, it does not explicitly warn users that these endpoints may expose private or security-relevant data and should be used only with appropriate authorization.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This shell script performs an API call to the UniFi controller and retrieves active client information, including IP and MAC addresses, which are potentially sensitive network details. The file contains no confirmation prompt, user-facing log/print disclosure, or explanatory comment warning that client inventory data will be fetched and displayed.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script persists a detailed UniFi inventory report to a memory-bank file under the user's home directory, creating a durable local record of network devices, clients, and configuration. That persistence is riskier than transient query/monitor behavior because future agents, users, or local processes may access sensitive network inventory without needing to re-authenticate to UniFi.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script silently writes sensitive network dashboard data to a local file without any user-facing notice or consent. In an agent-skill context, undisclosed persistence is more dangerous because users may reasonably expect a monitoring command to be read-only and ephemeral.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The dashboard fetches and exposes sensitive administrative data well beyond simple monitoring, including port forwards, firewall rules, network definitions, WLAN configuration, routing, alarms, and system info. In the context of a monitoring skill, this broad collection increases disclosure risk because it reveals internal topology, exposed services, and security controls that could aid an attacker if the output is read, logged, or reused elsewhere.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The debug block writes raw API responses for health, devices, clients, networks, and WLANs to a local JSON file, which can contain detailed internal identifiers and configuration data. Raw dumps are especially dangerous because they bypass any later formatting or redaction and may be easier for another tool or attacker to parse and exploit.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The debug JSON dump stores collected API data locally without warning the user, creating hidden persistence of sensitive information. Because this file is separate from the main report and intended for troubleshooting, it may be overlooked and left behind indefinitely, increasing exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script reads a username and password from a local config file and sends them to the UniFi controller via curl, but the only nearby comments describe functionality rather than warning the user about credential handling or network transmission. Under the code-file criteria, accessing sensitive credentials and making HTTP requests that transmit them should have some user disclosure unless clearly warned elsewhere.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
97% confidence
Finding

The script uses curl with -k, which disables TLS certificate verification during login and subsequent API requests. This allows a man-in-the-middle on the network to intercept or modify the HTTPS session, potentially stealing the UniFi username/password and authenticated session cookies. In the context of a network-management skill, that is especially dangerous because compromise of the controller can expose device inventory, client activity, and administrative control.

Content

Scanner excerpt · scripts/unifi-api.sh (reported line 33)May include surrounding context.

sh
payload=$(jq -nc --arg username "$UNIFI_USER" --arg password "$UNIFI_PASS" '{username:$username,password:$password}')
  
  # Try login
  curl -sk -c "$cookie_file" \
    -H "Content-Type: application/json" \
    -X POST \
    "$UNIFI_URL/api/auth/login" \

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README explicitly instructs users to source a helper script, which can place authentication material into the current shell environment and broaden exposure beyond the immediate UniFi query task. Even if intended for convenience, sourcing increases the chance that credentials are inherited by child processes, exposed via shell debugging/history, or misused in unrelated commands.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This shell script performs a network/API request to the UniFi controller via unifi_get but provides no confirmation prompt, logging, or explanatory comment describing that it will contact the controller and retrieve alert data. For code files, network operations that transmit or access system data should have some visible disclosure unless already clearly communicated as part of the skill's stated purpose within the file or accompanying markdown.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This shell script performs an API request to the UniFi controller and fetches device information, including IPs and client counts. There is no confirmation prompt, warning message, or explanatory comment indicating to the user that network access and potentially sensitive infrastructure data retrieval will occur.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.