CSRF bypass in Echo via MethodOverride rewriting POST requests
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- High
- Impact type
- Tampering
- Confidentiality · integrity · availability
- None · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-352.
Summary
Echo, a Go web framework, is affected before 4.16.0 and from 5.0.0 before 5.4.0. When MethodOverride is registered before CSRF, it rewrites a POST to a safe method, so CSRF skips its token and Sec-Fetch-Site checks (CWE-352). A cross-site attacker can exploit this against an authenticated victim when the override value comes from a form getter that a browser-submitted form can set.
Written with Claude Haiku 5.5 from the sources below · 2026-11-06
Description from the CNA
Echo is a Go web framework. Prior to 4.16.0 and 5.4.0, Echo's MethodOverride middleware accepts a safe HTTP method as the override target for a POST request. When MethodOverride is registered before CSRF in the post-routing middleware chain, route selection retains the original state-changing POST handler but the override changes the method before CSRF evaluates it, causing both token validation and Sec-Fetch-Site checks to be skipped. A cross-site exploit requires an authenticated victim and an override value that a browser-submitted request can control, such as the form getter used by the advisory reproducer; the default X-HTTP-Method-Override header getter is not settable by a cross-site form. This issue is fixed in 4.16.0 and 5.4.0.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| labstack | echo | before 4.16.0; 5.0.0 to before 5.4.0 | 4.16.0, 5.4.0 | Patch available | CNA |
| — | github.com/labstack/echo/v5 (Go) | 5.0.0 to before 5.4.0 | 5.4.0 | Patch available | GHSA-r7w9-592q-9vg4 |
| — | github.com/labstack/echo/v4 (Go) | before 4.16.0 | 4.16.0 | Patch available | GHSA-r7w9-592q-9vg4 |
- echo Vendorlabstack Affected before 4.16.0; 5.0.0 to before 5.4.0 Fixed in 4.16.0, 5.4.0 Patch available CNA
- github.com/labstack/echo/v5 (Go) Vendor— Affected 5.0.0 to before 5.4.0 Fixed in 5.4.0 Patch available GHSA-r7w9-592q-9vg4
- github.com/labstack/echo/v4 (Go) Vendor— Affected before 4.16.0 Fixed in 4.16.0 Patch available GHSA-r7w9-592q-9vg4
Remediation
Upgrade the github.com/labstack/echo/v4 module to 4.16.0 and the github.com/labstack/echo/v5 module to 5.4.0.
Written with Claude Haiku 5.5 from the sources below · 2026-11-06
- Fix · CNA echo (labstack) Fixed in 4.16.0, 5.4.0
- Fix · GHSA-r7w9-592q-9vg4 github.com/labstack/echo/v5 (Go) Fixed in 5.4.0 Advisory →
- Fix · GHSA-r7w9-592q-9vg4 github.com/labstack/echo/v4 (Go) Fixed in 4.16.0 Advisory →
Vendor assessments
Timeline
- 2026-10-28 Threatist record created from CVE-2026-118266
- 2026-10-28 Alias added: GHSA-r7w9-592q-9vg4
- 2026-10-28 Fix available: Go/github.com/labstack/echo/[email protected], Go/github.com/labstack/echo/[email protected] · GHSA-r7w9-592q-9vg4
- 2026-10-28 CVSS score added · GHSA-r7w9-592q-9vg4
- 2026-10-28 Weakness changed · GHSA-r7w9-592q-9vg4
- 2026-10-28 6 new references · GHSA-r7w9-592q-9vg4
- 2026-11-03 CISA SSVC decision points changed
- 2026-11-03 Priority changed: LOW → MEDIUM
- 2026-11-06 Affected versions changed · Red Hat
- 2026-11-06 CVSS score added · Red Hat
References
Other 6
- https://github.com/labstack/echo/security/advisories/GHSA-r7w9-592q-9vg4
- https://github.com/labstack/echo/commit/b838391e2eade87ae7e5a09d7bb5087bec271ec1
- https://github.com/labstack/echo/commit/fc410094b2f3415cf2bf5204082137b205bfd5af
- https://github.com/labstack/echo/releases/tag/v4.16.0
- https://github.com/labstack/echo/releases/tag/v5.4.0
- https://github.com/labstack/echo
More labstack vulnerabilities
- TI-2022-18981 Labstack Echo v4.8.0 was discovered to contain an open redirect vulnerability via the… CVSS 3.1CRITICAL 9.6
- TI-2026-82185 Path decoding mismatch in Echo middleware.Static exposes static files CVSS 3.1HIGH 7.5
- TI-2026-40198 Echo: Encoded slash (%2F) bypasses route-level protection and exposes static files CVSS 3.1HIGH 7.5
- TI-2026-82194 Rate limiter bypass in Echo via spoofed X-Forwarded-For header CVSS 3.1MEDIUM 5.3
- TI-2026-20833 Echo has a Windows path traversal via backslash in middleware.Static default filesystem CVSS 3.1MEDIUM 5.3
- TI-2020-18793 Directory traversal on Windows in github.com/labstack/echo/v4 CVSS 3.1MEDIUM 5.3
Sources
- CVE-2026-118266 · CVE Program
- CVE-2026-118266 · NVD
- FIRST EPSS
- GHSA-r7w9-592q-9vg4 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-118266 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences