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

- Severity: Medium 5.4 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.38%, higher than 34% of CVEs (2026-12-01)
- Published: 2025-04-14T15:26:07.000Z
- Modified: 2026-09-10T03:50:24.038Z
- Also known as: GHSA-rq77-p4h8-4crw, GO-2025-3607
- Related: CVE-2025-46721, CGA-qh25-2wj2-22qp
- Weaknesses: CWE-352
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- gorilla csrf: < 1.7.3
- github.com/gorilla/csrf (Go): before 1.7.3

## Every score

- GitHub_M: CVSS:4.0 5.4 Medium `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`
- GitHub: CVSS:4.0 Medium `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`

## References

- <https://github.com/gorilla/csrf/security/advisories/GHSA-rq77-p4h8-4crw> (advisory, web)
- <https://github.com/gorilla/csrf/commit/9dd6af1f6d30fc79fb0d972394deebdabad6b5eb> (fix, web)
- <https://lists.debian.org/debian-lts-announce/2025/05/msg00002.html> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2025-24358> (advisory)
- <https://github.com/gorilla/csrf> (package)
- <https://pkg.go.dev/vuln/GO-2025-3607> (web)

## Sources

- CVE List: [CVE-2025-24358](https://www.cve.org/CVERecord?id=CVE-2025-24358), CVE Terms of Use, modified 2025-05-01
- GitHub Advisory Database: [GHSA-rq77-p4h8-4crw](https://github.com/advisories/GHSA-rq77-p4h8-4crw), CC-BY-4.0, modified 2026-09-10
- Go Vulnerability Database: [GO-2025-3607](https://pkg.go.dev/vuln/GO-2025-3607), CC-BY-4.0, modified 2026-02-04
- NVD: [CVE-2025-24358](https://nvd.nist.gov/vuln/detail/CVE-2025-24358), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2025-24358 · Whole record: https://cve.day/CVE-2025-24358.json · Rebuilt by cve.day 2026-11-25T22:58:56.477Z
