GO-2026-6978: CSRF protection bypass via _method override in github.com/mikehelmick/go-bananas

Published Nov 23, 2026
·
Updated

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 Software

1 affected componentFixes available
go/github.com/mikehelmick/go-bananas<1.0.2
1.0.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/mikehelmick/go-bananas to a version that resolves this vulnerability.

    Fixed in 1.0.2

Event History

Nov 23, 2026
Advisory Published
via OSV·08:04 PM
Data Sourced
via OSV·08:04 PM
DescriptionAffected Software

Frequently Asked Questions

1

Which deployments are exposed?

Deployments are exposed when middleware.MutateMethod is installed as router middleware before middleware.HandleCSRF. In that order, a method override can cause the CSRF middleware to see a safe method while the request is routed to a POST handler.

2

What does an attacker need to send?

An attacker needs to induce a cross-site POST request containing _method=GET in the query string or request body. This causes MutateMethod to override the method observed by HandleCSRF, which then skips CSRF token validation.

3

What can be done before a fix is applied?

Ensure middleware.MutateMethod is not placed ahead of middleware.HandleCSRF in the router middleware order. Review whether _method overrides from query strings or request bodies are accepted in routes protected by CSRF validation.

4

How can I check whether my application is affected?

Inspect router middleware registration order and identify whether MutateMethod runs before HandleCSRF. Test or review whether a POST request with _method=GET reaches a POST handler while the CSRF middleware treats it as a GET request.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203