CVE-2025-24358 gorilla/csrf CSRF vulnerability due to broken Referer validation
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- Proof of concept public · automatable: no · technical impact: partial
- Technology
- UbuntuDebian
Description
gorilla/csrf provides Cross Site Request Forgery (CSRF) prevention middleware for Go web applications & services. Prior to 1.7.2, gorilla/csrf does not validate the Origin header against an allowlist. Its executes its validation of the Referer header for cross-origin requests only when it believes the request is being served over TLS. It determines this by inspecting the r.URL.Scheme value. However, this value is never populated for "server" requests per the Go spec, and so this check does not run in practice. This vulnerability allows an attacker who has gained XSS on a subdomain or top level domain to perform authenticated form submissions against gorilla/csrf protected targets that share the same top level domain. This vulnerability is fixed in 1.7.2.
Upgrade path
9 packages: 3 fixed, 5 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| debian/golang-github-gorilla-csrf(Debian 12) | = 1.7.1-1; = 1.7.2+ds1-1; = 1.7.2+ds1-2; = 1.7.2+ds1-3 +3 more | No fix listed | No fix yet |
| ubuntu/golang-github-gorilla-csrf(Ubuntu 22.04) | All versions | No fix listed | No fix yet |
| ubuntu/golang-github-gorilla-csrf(Ubuntu 24.04) | All versions | No fix listed | No fix yet |
| ubuntu/golang-github-gorilla-csrf(Ubuntu 26.04) | All versions | No fix listed | No fix yet |
| ubuntu/golang-github-gorilla-csrf(Ubuntu 26.10) | All versions | No fix listed | No fix yet |
| debian/golang-github-gorilla-csrf(Debian 13) | < 1.7.2+ds1-2 | 1.7.2+ds1-2 | Fixed |
| debian/golang-github-gorilla-csrf(Debian 14) | < 1.7.2+ds1-2 | 1.7.2+ds1-2 | Fixed |
| gorilla github.com/gorilla/csrf(Go) | < 1.7.3 | 1.7.3 | Fixed |
| gorilla github.com/gorilla/csrf | = < 1.7.3 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| gorilla github.com/gorilla/csrf(Go) | < 1.7.3 | 1.7.3 |
| debian/golang-github-gorilla-csrf(Debian:12) | All versions | No fix listed |
| debian/golang-github-gorilla-csrf(Debian:12) | = 1.7.1-1 | No fix listed |
| debian/golang-github-gorilla-csrf(Debian:12) | = 1.7.2+ds1-1 | No fix listed |
| debian/golang-github-gorilla-csrf(Debian:12) | = 1.7.2+ds1-2 | No fix listed |
| debian/golang-github-gorilla-csrf(Debian:12) | = 1.7.2+ds1-3 | No fix listed |
| debian/golang-github-gorilla-csrf(Debian:12) | = 1.7.2-1 | No fix listed |
| debian/golang-github-gorilla-csrf(Debian:12) | = 1.7.2-1~bpo12+1 | No fix listed |
| debian/golang-github-gorilla-csrf(Debian:13) | < 1.7.2+ds1-2 | 1.7.2+ds1-2 |
| debian/golang-github-gorilla-csrf(Debian:14) | < 1.7.2+ds1-2 | 1.7.2+ds1-2 |
| gorilla github.com/gorilla/csrf | = < 1.7.3 | No fix listed |
| ubuntu/golang-github-gorilla-csrf(Ubuntu:22.04) | All versions | No fix listed |
| ubuntu/golang-github-gorilla-csrf(Ubuntu:24.04) | All versions | No fix listed |
| ubuntu/golang-github-gorilla-csrf(Ubuntu:26.04) | All versions | No fix listed |
| ubuntu/golang-github-gorilla-csrf(Ubuntu:26.10) | All versions | No fix listed |
References
- https://github.com/gorilla/csrf/security/advisories/GHSA-rq77-p4h8-4crw vendor-advisory
- nvd.nist.gov third-party-advisory vendor-advisory
- https://github.com/gorilla/csrf/commit/9dd6af1f6d30fc79fb0d972394deebdabad6b5eb patch
- github.com product
- lists.debian.org
- pkg.go.dev
- Debian Security Tracker CVE-2025-24358 vendor-advisory
- github.com
- Ubuntu CVE tracker vendor-advisory
- www.cve.org
- bugs.debian.org issue-tracking