T09 · Insecure Skill Coding Practices
Error
- Location
- assets/docker-compose.yml:17
- Finding
- Traefik Management API and Dashboard Exposed Without Authentication or TLS<![CDATA[ ## Vulnerability Details **File Location**: `assets/docker-compose.yml:17-19`; `assets/traefik-dynamic.yml:3-8` **Vulnerability Type**: Unauthenticated management interface exposure **Risk Level**: High ### Vulnerable Code `assets/docker-compose.yml:17-19`: ```yaml # API & Dashboard - --api=true - --api.dashboard=true - --api.insecure=true ``` `assets/traefik-dynamic.yml:3-8`: ```yaml # Traefik Dashboard traefik: rule: "Host(`traefik.192.168.9.192.nip.io`)" service: api@internal entryPoints: - web ``` The insecure configuration is also presented as a feature in `references/features.md:7-14`. ### Technical Analysis The supplied deployment template enables Traefik's insecure API mode and routes the internal API/dashboard service through the plaintext `web` entry point. The router has no authentication, IP allowlist, or security middleware. Although insecure API mode normally creates a dedicated management entry point, the dynamic router separately makes `api@internal` reachable through published port 80. Consequently, access does not depend solely on whether port 8080 is published by Docker. The `.nip.io` hostname does not provide access control. A client can resolve the hostname normally or directly send the required `Host` header to the server IP. Because the route uses HTTP, management traffic and infrastructure metadata are also exposed to interception on an untrusted network. ### Attack Path 1. An attacker identifies a host running the supplied configuration and confirms that TCP port 80 is reachable. 2. The attacker requests `http://traefik.192.168.9.192.nip.io/` or sends `Host: traefik.192.168.9.192.nip.io` directly to the server IP. 3. Traefik matches the unauthenticated router and forwards the request to `api@internal`. 4. The attacker accesses dashboard and API endpoints without credentials. 5. The attacker enumerates routers, services, middlewares, entry points, backend nam ...[truncated 771 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove insecure API mode: ```yaml - --api=true - --api.dashboard=true - --api.insecure=false ``` 2. Route `api@internal` only through the TLS-enabled `websecure` entry point. 3. Add an authentication middleware using securely provisioned credentials or an external identity provider. 4. Add an `ipAllowList` middleware restricting access to trusted administration networks. 5. Enforce HTTP-to-HTTPS redirection and configure valid TLS certificates. 6. Restrict management access at the host firewall, load balancer, or VPN layer. 7. Replace the concrete private-address hostname with an explicit deployment variable. 8. Clearly separate development-only examples from production templates and make secure behavior the default. ]]>
