CVE-2025-24358
MEDIUM 5.4CVSS 4.0gorilla/csrf CSRF vulnerability due to broken Referer validation
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.
- Published
- 15 Apr 2025
- Last modified
- 10 Sep 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Deferred
- Weakness
- CWE-352
- Also known as
- GHSA-rq77-p4h8-4crwGO-2025-3607
- Sources
- NVDJSONOSV GHSA-rq77-p4h8-4crwJSONOSV GO-2025-3607JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 4.0 | MEDIUM 5.4 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | Go | github.com/gorilla/csrf | < 1.7.3 | 1.7.3 |
References
- https://github.com/gorilla/csrf/commit/9dd6af1f6d30fc79fb0d972394deebdabad6b5eb · WEB, FIX
- https://github.com/gorilla/csrf/security/advisories/GHSA-rq77-p4h8-4crw · WEB, ADVISORY
- https://lists.debian.org/debian-lts-announce/2025/05/msg00002.html · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2025-24358 · ADVISORY
- https://github.com/gorilla/csrf · PACKAGE
- https://pkg.go.dev/vuln/GO-2025-3607 · WEB
History
- 25 Nov 2026 20:57 UTC · NVD: first stored (published 15 Apr 2025)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 22 Apr 2025)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 14 Apr 2025)