Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/labstack/echo/v5
  4. ›
  5. CVE-2026-118266

CVE-2026-118266: Echo has CSRF Protection Bypass via MethodOverride Rewriting POST to Safe Method

October 28, 2026

The MethodOverride middleware accepts any non-empty string as the override target method — including safe methods (GET, HEAD, OPTIONS, TRACE) — when rewriting a POST request. When MethodOverride is registered before CSRF in the post-routing middleware chain (e.Use()), it rewrites the request method to a safe method before CSRF evaluates it. The CSRF middleware then skips token validation for the now-safe method, allowing state-changing POST handlers to execute without any CSRF check. Both the legacy token path and the modern Sec-Fetch-Site protection path are bypassed simultaneously.

References

  • github.com/advisories/GHSA-r7w9-592q-9vg4
  • 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-r7w9-592q-9vg4
  • nvd.nist.gov/vuln/detail/CVE-2026-118266

Code Behaviors & Features

Detect and mitigate CVE-2026-118266 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 →

Affected versions

All versions starting from 5.0.0 before 5.4.0

Fixed versions

  • 5.4.0

Solution

Upgrade to version 5.4.0 or above.

Impact 5.3 MEDIUM

CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-352: Cross-Site Request Forgery (CSRF)

Source file

go/github.com/labstack/echo/v5/CVE-2026-118266.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Thu, 29 Oct 2026 00:16:48 +0000.