gorilla/csrf CSRF vulnerability due to broken Referer validation
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Passive
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- Tampering
- Confidentiality · integrity · availability
- None · High · None
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and GitHub. Impact type from CWE-352.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| gorilla | csrf | before 1.7.3 | 1.7.3 | Patch available | CNA |
| — | github.com/gorilla/csrf (Go) | before 1.7.3 | 1.7.3 | Patch available | GHSA-rq77-p4h8-4crw |
- csrf Vendorgorilla Affected before 1.7.3 Fixed in 1.7.3 Patch available CNA
- github.com/gorilla/csrf (Go) Vendor— Affected before 1.7.3 Fixed in 1.7.3 Patch available GHSA-rq77-p4h8-4crw
Remediation
- Fix · CNA csrf (gorilla) Fixed in 1.7.3
- Fix · GHSA-rq77-p4h8-4crw github.com/gorilla/csrf (Go) Fixed in 1.7.3 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2025-24358
- 2026-10-03 Alias added: GHSA-rq77-p4h8-4crw
References
More gorilla vulnerabilities
- TI-2024-24810 Potential memory exhaustion attack due to sparse slice deserialization CVSS 3.1HIGH 7.5
Sources
- CVE-2025-24358 · CVE Program
- CVE-2025-24358 · NVD
- FIRST EPSS
- GHSA-rq77-p4h8-4crw · GitHub Advisory Database · CC BY 4.0
- CVE-2025-24358 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences