CVE-2025-24358 Details
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.
A Cross-Site Request Forgery (CSRF) vulnerability has been identified in the Gorilla CSRF package for Go web applications, affecting versions prior to 1.7.2. The vulnerability arises because the package does not validate the Origin header against an allowlist and only checks the Referer header for cross-origin requests when it assumes the request is over TLS. This assumption is flawed, as the URL scheme is not populated for server requests, leaving a gap in validation. Consequently, an attacker with Cross-Site Scripting (XSS) access on a subdomain or top-level domain can exploit this to perform authenticated form submissions on targets sharing the same top-level domain.
Users can upgrade to Gorilla CSRF version 1.7.2 or later, where this vulnerability is fixed.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Apr 15, 2025CISA-ADP
Assessed Apr 15, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://lists.debian.org/debian-lts-announce/2025/05/msg00002.html | CVE | AdvisoryMailing ListRemedy |
| https://github.com/gorilla/csrf/commit/9dd6af1f6d30fc79fb0d972394deebdabad6b5eb | [email protected] | Source CodeVendor |
| https://github.com/gorilla/csrf/security/advisories/GHSA-rq77-p4h8-4crw | [email protected] | AdvisoryExploit |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-352 | Cross-Site Request Forgery (CSRF) | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| github.com/gorilla/csrf | All versions |
CPE
Remediation
| |
| Debian | < 1.7.2 (semver) |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| May 1, 2025 | CVE Modified | CVE |
| Apr 15, 2025 | New CVE Received | [email protected] |
Volerion