Technical impact
Echo’s Context.Scheme logic unconditionally trusts any forwarded scheme header sent by the client. Consequently, an attacker who connects over unencrypted HTTP can set the scheme value to HTTPS, causing the framework to treat the request as secure and skip the HTTPSRedirect middleware. Separately, an attacker that controls the TLS‑terminating proxy can inject a forwarded scheme claiming HTTP, which not only masquerades the connection as insecure but also suppresses the Strict‑Transport‑Security header even though the browser receives the response over HTTPS. This allows secure‑only redirects and browser‑enforced HTTPS to be bypassed, potentially downgrading traffic or evading HSTS protection. The weakness is an improper trust of a forwarded value (CWE‑346).
Affected Systems
The vulnerability affects any deployed instance of the Labstack Echo framework that is older than version 4.16.0 or 5.4.0. All releases prior to those, such as Echo 4.15.9 and earlier, or Echo 5.3.x and earlier, are vulnerable because they lack a mechanism to restrict trusted sources for forwarded scheme headers.
Risk and Exploitability
The base metric CVSS score of 5.9 indicates moderate severity. The EPSS score is < 1%, and the vulnerability is not listed in the CISA KEV catalog. Exploitation requires an attacker to send a forged forwarded scheme header either directly to the application over plain HTTP or via a TLS‑terminating proxy that forwards the header. The description specifies that the framework trusts forwarded scheme headers from any client; it does not name a particular header, but the analysis infers that common headers such as X‑Forwarded‑Proto could be used. If direct backend access is blocked and a trusted proxy reliably overwrites forwarded headers, the practical risk is reduced, yet the framework provides no built‑in guard against untrusted forwarded headers.
Github GHSA