CVE-2026-118657: Echo: HTTPS Redirect and HSTS Bypass via Unconditional Trust of Forwarded Scheme Headers
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.
The trusted headers (checked in this order of precedence):
X-Forwarded-ProtoX-Forwarded-ProtocolX-Forwarded-SslX-Url-Scheme
References
- github.com/advisories/GHSA-2ffq-g2xg-c22p
- github.com/labstack/echo/commit/b838391e2eade87ae7e5a09d7bb5087bec271ec1
- github.com/labstack/echo/commit/fc410094b2f3415cf2bf5204082137b205bfd5af
- github.com/labstack/echo/releases/tag/v4.16.0
- github.com/labstack/echo/releases/tag/v5.4.0
- github.com/labstack/echo/security/advisories/GHSA-2ffq-g2xg-c22p
- nvd.nist.gov/vuln/detail/CVE-2026-118657
Code Behaviors & Features
Detect and mitigate CVE-2026-118657 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →