CVE-2025-24358
gorilla/csrf provides Cross Site Request Forgery (CSRF) prevention …
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 now
- Check your exposureFind out whether the affected software runs anywhere in your environment, including systems of suppliers.
- UpdateInstall the version in which the vendor fixed the vulnerability. The references lead to the advisory.
- Limit access until thenIf you cannot update at once, take the system off the internet or restrict who can reach it.
References
- github.com/gorilla/csrf/commit/9dd6af1f6d30fc79fb0d972394deebdabad6b5eb
- github.com/gorilla/csrf/security/advisories/GHSA-rq77-p4h8-4crw
- lists.debian.org/debian-lts-announce/2025/05/msg00002.html
- nvd.nist.gov/vuln/detail/CVE-2025-24358
- pkg.go.dev/vuln/GO-2025-3607
- github.com/advisories/GHSA-rq77-p4h8-4crw
- nvd.nist.gov/vuln/detail/CVE-2025-24358
- cve.org/CVERecord?id=CVE-2025-24358
Data: CVE list and the NVD. This product uses data from the NVD API but is not endorsed or certified by the NVD.