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
- Upgrade the github.com/mikehelmick/go-bananas package to version 1.0.2 or higher.
- Verify the ordering of middleware in the application router to ensure security validations are not bypassed by method mutation.
How to check your project
- Inspect go.mod files to identify if github.com/mikehelmick/go-bananas version < 1.0.2 is in use.
- Run 'go list -m github.com/mikehelmick/go-bananas' in the project root to confirm the installed version.
Automated analysis of the published advisory data, generated 2026-11-23. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| 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
References
- ADVISORY https://github.com/mikehelmick/go-bananas/security/advisories/GHSA-g2rq-85pp-c2j9
- FIX https://github.com/mikehelmick/go-bananas/commit/5b7640b0a46a4be3b02a3b90f511c5a0da6b219b
- FIX https://github.com/mikehelmick/go-bananas/commit/f2b0abd115b3fea1ac75bbe4eda4fb9b3d24f78f
- WEB https://github.com/mikehelmick/go-bananas/releases/tag/v1.0.2
Source records: GO-2026-6978 (OSV.dev).