CVE-2025-24358gorilla/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.
What to do
Fixed builds are available from Debian, Go: see the table below for the fixed version per release.
Debian, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | golang-github-gorilla-csrf | Fix pending | UBUNTU-CVE-2025-24358 | |
| Ubuntu 26.04 | golang-github-gorilla-csrf | Under investigation | UBUNTU-CVE-2025-24358 | |
| Ubuntu 25.10 | golang-github-gorilla-csrf | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2025-24358 | |
| Ubuntu 24.04 | golang-github-gorilla-csrf | Under investigation | UBUNTU-CVE-2025-24358 | |
| Ubuntu 22.04 | golang-github-gorilla-csrf | Under investigation | UBUNTU-CVE-2025-24358 | |
| Ubuntu 20.04 | golang-github-gorilla-csrf | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2025-24358 | |
| Debian 14 | golang-github-gorilla-csrf | Fixed | 1.7.2+ds1-2 | DEBIAN-CVE-2025-24358 |
| Debian 13 | golang-github-gorilla-csrf | Fixed | 1.7.2+ds1-2 | DEBIAN-CVE-2025-24358 |
| Debian 12 | golang-github-gorilla-csrf | Fix pending | DEBIAN-CVE-2025-24358 | |
| Go library | github.com/gorilla/csrf | Fixed | 1.7.3 | GHSA-rq77-p4h8-4crw |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- gorilla csrf: affected: < 1.7.3
References
- https://github.com/gorilla/csrf/security/advisories/GHSA-rq77-p4h8-4crw
- https://github.com/gorilla/csrf/commit/9dd6af1f6d30fc79fb0d972394deebdabad6b5eb
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.