SEVERITY NOT PROVIDED

GHSA-g2rq-85pp-c2j9: CSRF protection bypass via _method override in github.com/mikehelmick/go-bananas

Published 2026-11-23 · Updated 2026-11-23 · Also known as GO-2026-6978

Summary

The middleware.MutateMethod component in github.com/mikehelmick/go-bananas allows attackers to bypass CSRF protection by overriding HTTP request methods. Engineering teams using this middleware should update their dependency to version 1.0.2 or later to ensure proper security validation.

Who is affected

The vulnerability occurs when middleware.MutateMethod is placed before the middleware.HandleCSRF component in the request pipeline. An attacker can use a cross-site POST request containing _method=GET to force the application to treat the request as a GET, causing the CSRF validator to skip security checks while the underlying router executes the original POST handler.

Exploitability

The vulnerability's severity and specific CVSS vector are not documented, and EPSS data is not yet available. CISA Known Exploited Vulnerabilities status is no, meaning there is no record of active exploitation.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-23. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
Go github.com/mikehelmick/go-bananas >= 0, < 1.0.2 1.0.2 go get github.com/mikehelmick/[email protected]

FAQ

What specifically triggers the CSRF bypass?

The bypass is triggered when an attacker includes _method=GET in a POST request, causing the middleware to misidentify the request type and circumvent CSRF validation logic.

Does this affect all users of go-bananas?

Only deployments using middleware.MutateMethod in combination with middleware.HandleCSRF are affected.

Is this vulnerability being actively exploited?

No, this vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog.

Original advisory 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.

References

Source records: GO-2026-6978 (OSV.dev).