gorilla/csrf
Package gorilla/csrf provides Cross Site Request Forgery (CSRF) prevention middleware for Go web applications & services 🔒 observed · 2026-08-28
Health v2 · maintenance only
30/100
- Activity 16
- Release rhythm 8
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 4049
- days_rel: 506
- days_push: 506
- n_releases_24m: 1
Adoption not part of the score
1209 stars · 174 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
gorilla/csrf is a Go HTTP middleware library that provides cross-site request forgery (CSRF) protection for web applications and services. It works with any framework built on Go's http.Handler interface, including net/http, Gorilla, Gin, and Echo.
Use cases
- protect go web forms from csrf attacks
- add csrf tokens to html forms in go
- secure json apis against cross-site request forgery
- add csrf middleware to gin or echo app
- generate hidden csrf input field in html/template
- prevent xsrf attacks in go http service
When to choose
- you need battle-tested CSRF protection for a Go web app or API
- you use net/http or any http.Handler-compatible router and want drop-in middleware
- you want template helpers for embedding CSRF tokens in HTML forms
When to avoid
- you are not writing a Go web application
- you need protection against other attack classes like XSS or SQL injection
- you want a full security suite rather than a single-purpose CSRF library
Facets
library · maturity stable
middleware security http-server web-development backend security go csrf csrf-protection xsrf gorilla-web-toolkit http-middleware web-server
2 sources
- readme: https://github.com/gorilla/csrf · fetched 2026-08-28 · 7bb278c504f4
- homepage: https://gorilla.github.io · fetched 2026-08-29 · aa93940b2bb1
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| gorilla/csrf | main | 30 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem