T09 · Insecure Skill Coding Practices
- Location
scripts/unifi.py:233- Finding
TLS Certificate Verification Is Disabled for Controller Connections
- Content
View full analysis
Controller: """Create and login to controller.""" host, username, password, port, site, _ = get_config() controller = Controller( Configuration( session, host, username=username, password=password, port=port, site=site, ssl_context=False, # Disable SSL verification for self-signed certs ) ) ``` ### Technical Analysis The controller is always initialized with `ssl_context=False`, disabling TLS certificate verification for every connection. Although this accommodates self-signed certificates, it prevents the client from authenticating the identity of the UniFi controller. An attacker with a suitable network position can present an arbitrary certificate without causing validation to fail. This makes HTTPS connections vulnerable to man-in-the-middle interception. Because the connection carries administrator credentials, authenticated session data, controller responses, and privileged management requests, disabling verification undermines both confidentiality and integrity. ### Attack Path 1. The user configures the Skill to connect to a UniFi controller over HTTPS. 2. An attacker obtains a network interception position, such as through a compromised gateway, malicious access point, ARP spoofing, or DNS manipulation. 3. The attacker redirects or intercepts traffic intended for the controller. 4. The attacker presents an untrusted certificate for an impersonated controller. 5. Because certificate verification is disabled, the client accepts the connection. 6. The attacker captures authentication data or session cookies, observes sensitive controller information, and may modify privileged API ...[truncated 604 chars]- Remediation
View remediation
