Description
middleware.MutateMethod accepts a _method override from the query string or request body and allows overriding the HTTP method to safe methods such as GET. When installed as router middleware ahead of middleware.HandleCSRF, a cross-site POST request with _method=GET is routed to the POST handler while HandleCSRF observes a GET request and skips CSRF token validation.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| Go | github.com/mikehelmick/go-bananas | < 1.0.2 | 1.0.2 | GO-2026-6978 |
References
- https://github.com/mikehelmick/go-bananas/security/advisories/GHSA-g2rq-85pp-c2j9 advisory
- https://github.com/mikehelmick/go-bananas/commit/5b7640b0a46a4be3b02a3b90f511c5a0da6b219b fix
- https://github.com/mikehelmick/go-bananas/commit/f2b0abd115b3fea1ac75bbe4eda4fb9b3d24f78f fix
- https://github.com/mikehelmick/go-bananas/releases/tag/v1.0.2 web