Back to skill

Security audit

Unifi

Security checks for vulnerabilities and agentic risk

Overview

This UniFi monitoring skill is read-only in intent, but it handles administrator credentials insecurely and persistently saves sensitive network inventory without clear user control.

Review before installing. Use only a dedicated least-privilege UniFi account if your controller supports it, do not reuse an owner or administrator password, and be aware the current scripts disable TLS verification. Treat the generated dashboard and debug files as sensitive network documentation; remove or protect them, and avoid running the dashboard from directories that may be synced, backed up, or committed.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (5)

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 The `-k` option instructs `curl` to accept an HTTPS certificate without verifying its trust chain or hostname. It is applied both when transmitting the administrator username and password and when making requests with the authenticated session cookie. Although self-signed certificates are common on local UniFi gateways, globally disabling certificate verification removes server authentication. Encryption alone does not protect these requests against an active man-in-the-middle attacker. The implementation also does not validate that `UNIFI_URL` uses HTTPS. ### Attack Path 1. A user configures the Skill with valid UniFi administrator credentials. 2. An attacker gains a position from which local traffic can be intercepted, such as through ARP spoofing, DNS manipulation, a compromised access point, or a malicious local gateway. 3. The attacker presents an arbitrary TLS certificate while impersonating the configured UniFi gateway. 4. Because `curl -k` accepts that certificate, the script sends the JSON login payload containing the username and password to the attacker. 5. The attacker may also capture the authenticated session cookie and API responses. 6. The stolen credentials or cookie are then used to access the real UniFi controller. ### Impact Assessment Successful exploitation can disclose UniFi administrator credentials, authenticated session cookies, client inventories, internal addresses, device identifiers, WLAN configuration, firewall rules, routes, and port-forwarding details. Because the documented setup asks for a local administra ...[truncated 119 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

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

Unvalidated Configured Destination Can Receive UniFi Credentials

Content
View full analysis
/dev/null ``` ### Technical Analysis The authentication destination is taken directly from a configurable JSON file, whose path can itself be overridden through `UNIFI_CONFIG_FILE`. The code performs no validation of the URL scheme, hostname, port, or address range before transmitting the username and password. Consequently, anyone able to influence the environment or credentials file can redirect authentication to an attacker-controlled server. The same primitive can cause requests from the Agent host to arbitrary destinations reachable from its network environment. This issue is especially serious in combination with disabled TLS certificate verification. ### Attack Path 1. An attacker modifies the default configuration file, supplies a malicious configuration, or influences the `UNIFI_CONFIG_FILE` environment variable. 2. The malicious configuration sets `.url` to an attacker-controlled endpoint or another sensitive internal service. 3. The user or Agent invokes any script that sources `unifi-api.sh`. 4. The script constructs a login payload containing the configured UniFi username and password. 5. The payload is posted to the attacker-selected URL without destination validation. 6. The attacker obtains the credential ...[truncated 446 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/dashboard.sh:7
Finding

Dashboard Persistently Writes Sensitive Network Inventory Without Secure Permissions

Content
View full analysis
dashboard_debug_dump.json 2>/dev/null ``` ```bash } | tee "$OUTPUT_FILE" ``` ### Technical Analysis Every dashboard invocation writes raw API data to `dashboard_debug_dump.json` in the current working directory. Human-readable output is also persisted to `$HOME/clawd/memory/bank/unifi-inventory.md`. The raw API responses may contain substantially more information than the fields displayed by the dashboard, including client hostnames, MAC addresses, internal IP addresses, SSIDs, device metadata, subnets, and topology details. The script does not set a restrictive `umask`, explicitly assign secure file modes, redact sensitive fields, obtain consent, or remove the debug dump after ...[truncated 1182 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Warning
Location
scripts/dashboard.sh:7
Finding

Network-Controlled Text Is Written Into Persistent Agent Memory

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
README.md:17
Finding

Setup Requires an Administrator Account Instead of a Least-Privilege Monitoring Role

Content
View full analysis
Remediation
View remediation
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 (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The code is broadly related to UniFi querying/monitoring, so the core domain matches. However, it does more than the declared description suggests. In addition to status-style monitoring (health, devices, clients, alarms), it accesses configuration-oriented endpoints for port forwards, firewall rules, network configs, WLAN configs, and routing, which is a materially broader and more sensitive capability than a simple monitoring/dashboard skill. It also persistently writes the resulting dashboard to ~/clawd/memory/bank/unifi-inventory.md and creates dashboard_debug_dump.json, which is not disclosed in the description. Because these undeclared capabilities involve sensitive config enumeration and data persistence, this should be flagged as a mismatch.

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**

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README explicitly states the scripts use curl with -k to disable TLS certificate verification for connections to the UniFi gateway. This makes the credentialed connection vulnerable to man-in-the-middle interception on the local network, especially because the same documentation instructs users to authenticate with a local admin account. In context, this is more dangerous than a generic doc issue because the skill is intended to query sensitive network-management APIs and may expose admin credentials, cookies, and monitoring data.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

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.

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
90% confidence
Finding

The skill advertises and operationalizes shell and network access but does not declare any explicit tool scope or permission boundary. In an agent environment, missing scope metadata increases the chance the skill will be invoked with broader capabilities than intended, reducing reviewability and making misuse or accidental overreach harder to prevent.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
86% confidence
Finding

The skill instructs users to store long-lived UniFi admin credentials in a persistent local JSON file under the home directory. Persistent plaintext secrets increase exposure to credential theft by other local processes, backups, logs, or accidental disclosure, especially because the account is an administrative UniFi OS user.

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
89% confidence
Finding

This markdown documents numerous read-only API calls that return potentially sensitive information, including admins, clients, device inventory, events, alarms, DPI traffic data, firewall rules, and RADIUS accounts. While it emphasizes read-only usage, it does not warn users that these endpoints may reveal private network, identity, or security configuration data.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script writes a persistent inventory report to $HOME/clawd/memory/bank/unifi-inventory.md and also creates a local debug JSON dump containing fetched UniFi data. This expands a read-only monitoring skill into undisclosed local data retention, increasing the chance that sensitive network topology, client, and configuration data is exposed to other local processes, backups, or later agent use without the user's awareness.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Writing network inventory to a fixed on-disk location without warning or confirmation violates user expectations for a monitoring command and creates silent persistence of sensitive data. In an agent setting, this is especially risky because later workflows may ingest the memory-bank file and spread confidential infrastructure details beyond the original request.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill retrieves and displays port forwards, firewall rules, network definitions, WLANs, and routes, which are sensitive configuration details beyond basic health/status monitoring described in the manifest. Even without modifying settings, broad enumeration increases exposure of attack-relevant information such as externally reachable services, segmentation layout, and wireless security posture.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The undeclared debug JSON dump silently stores raw fetched network data, including client and configuration information, for troubleshooting. Hidden persistence is dangerous because users may not realize sensitive operational details have been left behind on disk, where they can be collected by backups, other users, or unrelated tooling.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
97% confidence
Finding

The script sends UniFi credentials over the network using curl with the -k option, which disables TLS certificate validation. That makes the login vulnerable to man-in-the-middle interception or credential theft if an attacker can influence the network path or DNS, and the same insecure flag is also used for authenticated GET requests.

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
98% confidence
Finding

The debug block writes aggregated UniFi JSON to dashboard_debug_dump.json without user notice or access controls. Because the dump includes health, device, client, network, and WLAN data, it can create a convenient local cache of sensitive network information that persists beyond the session and may be readable by unintended parties.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The script reads the UniFi URL, username, and password from a credentials file, which is a sensitive operation involving authentication material. While this is functionally expected for an API helper, the file itself provides no user-facing notice, prompt, or warning that stored credentials will be accessed and used.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.