GHSA-cqgf-f4x7-g6wc: Ech0: Unauthenticated SSRF in GetWebsiteTitle allows access to internal services and cloud metadata
SummaryThe `GET /api/website/title` endpoint accepts an arbitrary URL via the `website_url` query parameter and makes a server-side HTTP request to it without any validation of the target host or IP address. The endpoint requires no authentication. An attacker can use this to reach internal network services, cloud metadata endpoints (169.254.169.254), and localhost-bound services, with partial response data exfiltrated via the HTML `<title>` tag extraction.DetailsThe vulnerability exists in the interaction between four components:**1. Route registration — no authentication** (`internal/router/common.go:11`):The `PublicRouterGroup` is created at `internal/router/router.go:34` as `r.Group("/api")` with no auth middleware attached (unlike `AuthRouterGroup` which uses `JWTAuthMiddleware`).**2. Handler — no input validation** (`internal/handler/common/common.go:106-127`):The DTO (`internal/model/common/common_dto.go:155-156`) only enforces `binding:"required"` — no URL scheme or host validation.**3. Service — TrimURL is cosmetic** (`internal/service/common/common.go:122-125`):`TrimURL` (`internal/util/http/http.go:16-26`) only calls `TrimSpace`, `TrimPrefix("/")`, and `TrimSuffix("/")`. No SSRF protections.**4. HTTP client — unrestricted outbound request** (`internal/util/http/http.go:53-84`):The client follows redirects (Go default), skips TLS verification, and has no restrictions on target IP ranges.The response body is parsed for `<title>` tags and the extracted title is returned to the attacker, providing a data exfiltration channel for any response containing HTML title elements.PoC**Step 1: Probe cloud metadata endpoint (AWS)**If the Ech0 instance runs on AWS EC2, the server will make a request to the instance metadata service. While the metadata response is not HTML, this confirms network reachability.**Step 2: Probe internal localhost services**Probes for Redis on localhost. Connection success/failure and error messages reveal internal service topology.**Step 3: Exfiltrate data from internal web services with HTML title tags**If the internal service returns an HTML page with a `<title>` tag, its content is returned to the attacker.**Step 4: Confirm with a controlled external server**Expected response contains `"data":"SSRF-CONFIRMED"`, proving the server made an outbound request to the attacker-controlled URL.Impact**Cloud credential theft**: An attacker can reach cloud metadata services (AWS IMDSv1 at `169.254.169.254`, GCP, Azure) to steal IAM credentials, API tokens, and instance configuration data.**Internal network reconnaissance**: Port scanning and service discovery of internal hosts that are not directly accessible from the internet.**Localhost service interaction**: Access to services bound to `127.0.0.1` (databases, caches, admin panels) that rely on network-level isolation for security.**Firewall bypass**: The server acts as a proxy, allowing attackers to bypass network ACLs and reach otherwise-protected internal infrastructure.**Data exfiltration**: Partial response content is leaked through the `<title>` tag extraction. While limited, this is sufficient to extract sensitive data from services that return HTML responses.The attack requires no authentication and can be performed by any anonymous internet user with network access to the Ech0 instance.Recommended FixAdd URL validation in `GetWebsiteTitle` to block requests to private/reserved IP ranges and restrict allowed schemes. In `internal/service/common/common.go`:Additionally, consider:Removing `InsecureSkipVerify: true` from `SendRequest` in `internal/util/http/http.go:69`Disabling redirect following in the HTTP client (`CheckRedirect` returning `http.ErrUseLastResponse`) or re-validating the target IP after each redirect to prevent DNS rebindingAdding rate limiting to this endpoint
CVSS v3.1: 7.2