CVE-2025-24358
gorilla/csrf CSRF vulnerability due to broken Referer validation
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Passive
What an attacker can affect
- Confidentiality
- None
- Integrity
- High
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
5.4
gorilla/csrf CSRF vulnerability due to broken Referer validation
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.
- Record
CVE-2025-24358- 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 - Weakness
- CWE-352
- Updated
- 2026-11-02
EUVDEUVD-2025-10883
5.4
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.
- Record
EUVD-2025-10883- 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 - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-rq77-p4h8-4crw
5.4
gorilla/csrf CSRF vulnerability due to broken Referer validation
Summary
gorilla/csrf is vulnerable to CSRF via form submission from origins that share a top level domain with the target origin.
Details
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.
// URL specifies either the URI being requested (for server
// requests) or the URL to access (for client requests).
//
// For server requests, the URL is parsed from the URI
// supplied on the Request-Line as stored in RequestURI. For
// most requests, fields other than Path and RawQuery will be
// empty. (See [RFC 7230, Section 5.3](https://rfc-editor.org/rfc/rfc7230.html#section-5.3))
//
// For client requests, the URL's Host specifies the server to
// connect to, while the Request's Host field optionally
// specifies the Host header value to send in the HTTP
// request.
URL *[url](https://pkg.go.dev/net/url).[URL](https://pkg.go.dev/net/url#URL)
PoC
- create trusted origin
target.example.testprotected with gorilla/csrf and served over TLS hosting form on/submit - create attacker origin
attack.example.testserved over TLS - attacker exfiltrates token & cookie combination from
target.example.test - attacker sets exfiltrated cookie with
domain=.example.test and path=/submit- as the cookie has a more specific path than
/(the default for CSRF cookies) it will be sent first by the browser on submit to our target origin
- as the cookie has a more specific path than
- submit form from
attack.example.testwith exfiltrated CSRF form token - observe valid form submission as
attack.example.testOrigin / Referer headers are not validated.
Impact
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 bug has existed in gorilla/csrf since its initial release in 2015.
- Record
GHSA-rq77-p4h8-4crw- 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 - Weakness
- CWE-352
- Updated
- 2026-11-02
NVD
5.4
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.
- Record
CVE-2025-24358- 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/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Weakness
- CWE-352
- Updated
- 2026-11-02
OSV
5.4
gorilla/csrf CSRF vulnerability due to broken Referer validation
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.
- Record
CVE-2025-24358- 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 - Weakness
- CWE-352
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2025-24358
5.4
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.
- Record
DEBIAN-CVE-2025-24358- 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/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Updated
- 2026-11-02
Show 5 moreShow less
OSVGHSA-rq77-p4h8-4crw
5.4
gorilla/csrf CSRF vulnerability due to broken Referer validation
Summary
gorilla/csrf is vulnerable to CSRF via form submission from origins that share a top level domain with the target origin.
Details
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.
// URL specifies either the URI being requested (for server
// requests) or the URL to access (for client requests).
//
// For server requests, the URL is parsed from the URI
// supplied on the Request-Line as stored in RequestURI. For
// most requests, fields other than Path and RawQuery will be
// empty. (See [RFC 7230, Section 5.3](https://rfc-editor.org/rfc/rfc7230.html#section-5.3))
//
// For client requests, the URL's Host specifies the server to
// connect to, while the Request's Host field optionally
// specifies the Host header value to send in the HTTP
// request.
URL *[url](https://pkg.go.dev/net/url).[URL](https://pkg.go.dev/net/url#URL)
PoC
- create trusted origin
target.example.testprotected with gorilla/csrf and served over TLS hosting form on/submit - create attacker origin
attack.example.testserved over TLS - attacker exfiltrates token & cookie combination from
target.example.test - attacker sets exfiltrated cookie with
domain=.example.test and path=/submit- as the cookie has a more specific path than
/(the default for CSRF cookies) it will be sent first by the browser on submit to our target origin
- as the cookie has a more specific path than
- submit form from
attack.example.testwith exfiltrated CSRF form token - observe valid form submission as
attack.example.testOrigin / Referer headers are not validated.
Impact
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 bug has existed in gorilla/csrf since its initial release in 2015.
- Record
GHSA-rq77-p4h8-4crw- 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 - Weakness
- CWE-352
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2025-24358
5.4
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.
- Record
UBUNTU-CVE-2025-24358- 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 - Updated
- 2026-11-02
OSVGO-2025-3607 No score
gorilla/csrf CSRF vulnerability due to broken Referer validation in github.com/gorilla/csrf
gorilla/csrf CSRF vulnerability due to broken Referer validation in github.com/gorilla/csrf
- Record
GO-2025-3607- Updated
- 2026-11-02
OSVopenSUSE-SU-2025:15017-1 No score
govulncheck-vulndb-0.0.20250422T181640-1.1 on GA media
These are all security issues fixed in the govulncheck-vulndb-0.0.20250422T181640-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2025:15017-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:11126-1 No score
velociraptor-0.7.0.4.git185.a5708584-2.1 on GA media
These are all security issues fixed in the velociraptor-0.7.0.4.git185.a5708584-2.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:11126-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
github.com/gorilla/csrfGo |
before 1.7.3 | 1.7.3 |
golang-github-gorilla-csrfDebian:12 |
All versions, plus listed versions 1.7.1-11.7.2+ds1-11.7.2+ds1-21.7.2+ds1-31.7.2-11.7.2-1~bpo12+1 |
None known |
golang-github-gorilla-csrfDebian:13 |
before 1.7.2+ds1-2 | 1.7.2+ds1-2 |
golang-github-gorilla-csrfDebian:14 |
before 1.7.2+ds1-2 | 1.7.2+ds1-2 |
golang-github-gorilla-csrfDebian:11 |
before 1.6.2-2+deb11u1, plus listed versions 1.6.2-2 |
1.6.2-2+deb11u1 |
golang-github-gorilla-csrfUbuntu:20.04:LTS |
All versions, plus listed versions 1.6.2-11.6.2-2 |
None known |
golang-github-gorilla-csrfUbuntu:22.04:LTS |
All versions, plus listed versions 1.6.2-2 |
None known |
golang-github-gorilla-csrfUbuntu:24.04:LTS |
All versions, plus listed versions 1.7.1-11.7.2-1 |
None known |
golang-github-gorilla-csrfUbuntu:25.10 |
All versions, plus listed versions 1.7.2+ds1-11.7.2+ds1-2 |
None known |
golang-github-gorilla-csrfUbuntu:26.10 |
All versions, plus listed versions 1.7.2+ds1-21.7.2+ds1-3 |
None known |
golang-github-gorilla-csrfUbuntu:26.04:LTS |
All versions, plus listed versions 1.7.2+ds1-2 |
None known |
govulncheck-vulndbopenSUSE:Tumbleweed From an advisory covering 23 CVEs |
before 0.0.20250422T181640-1.1 | 0.0.20250422T181640-1.1 |
velociraptoropenSUSE:Tumbleweed From an advisory covering 49 CVEs |
before 0.7.0.4.git185.a5708584-2.1 | 0.7.0.4.git185.a5708584-2.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-24358 is a medium vulnerability (CVSS 5.4) in Gorilla Csrf, published April 14, 2025. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.37%, the 31st percentile. Fixed in github.com/gorilla/csrf 1.7.3.
References
github.com/gorilla/csrf/security/advisories/GHSA-rq77-p4h8-4crw
github.com/gorilla/csrf/commit/9dd6af1f6d30fc79fb0d972394deebdabad6b5eb
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
Show 77 moreShow less
github.com/CVEProject/cvelistV5/tree/main/cves/2025/24xxx/CVE-2025-24358.json
security-tracker.debian.org/tracker/CVE-2025-24358
github.com/gorilla/csrf
ubuntu.com/security/CVE-2025-24358
cve.org/CVERecord?id=CVE-2025-24358
lists.opensuse.org/archives/list/[email protected]/thread/XCF7AZBKQYAQXK32J6F54H6NREFBK2V7
suse.com/security/cve/CVE-2019-15119
suse.com/security/cve/CVE-2025-1386
suse.com/security/cve/CVE-2025-2424
suse.com/security/cve/CVE-2025-24358
suse.com/security/cve/CVE-2025-2475
suse.com/security/cve/CVE-2025-24839
suse.com/security/cve/CVE-2025-24866
suse.com/security/cve/CVE-2025-2564
suse.com/security/cve/CVE-2025-27538
suse.com/security/cve/CVE-2025-27571
suse.com/security/cve/CVE-2025-27936
suse.com/security/cve/CVE-2025-30206
suse.com/security/cve/CVE-2025-31363
suse.com/security/cve/CVE-2025-32093
suse.com/security/cve/CVE-2025-32431
suse.com/security/cve/CVE-2025-32445
suse.com/security/cve/CVE-2025-32793
suse.com/security/cve/CVE-2025-32963
suse.com/security/cve/CVE-2025-3801
suse.com/security/cve/CVE-2025-43970
suse.com/security/cve/CVE-2025-43971
suse.com/security/cve/CVE-2025-43972
suse.com/security/cve/CVE-2025-43973
suse.com/security/cve/CVE-2023-45288
suse.com/security/cve/CVE-2024-45339
suse.com/security/cve/CVE-2025-13465
suse.com/security/cve/CVE-2025-22868
suse.com/security/cve/CVE-2025-22869
suse.com/security/cve/CVE-2025-22870
suse.com/security/cve/CVE-2025-22872
suse.com/security/cve/CVE-2025-47911
suse.com/security/cve/CVE-2025-58058
suse.com/security/cve/CVE-2025-58181
suse.com/security/cve/CVE-2025-58190
suse.com/security/cve/CVE-2025-5889
suse.com/security/cve/CVE-2025-64718
suse.com/security/cve/CVE-2025-6545
suse.com/security/cve/CVE-2025-6547
suse.com/security/cve/CVE-2025-7783
suse.com/security/cve/CVE-2026-1229
suse.com/security/cve/CVE-2026-25128
suse.com/security/cve/CVE-2026-25680
suse.com/security/cve/CVE-2026-25681
suse.com/security/cve/CVE-2026-26278
suse.com/security/cve/CVE-2026-26996
suse.com/security/cve/CVE-2026-27136
suse.com/security/cve/CVE-2026-2739
suse.com/security/cve/CVE-2026-27606
suse.com/security/cve/CVE-2026-27904
suse.com/security/cve/CVE-2026-33036
suse.com/security/cve/CVE-2026-33186
suse.com/security/cve/CVE-2026-33487
suse.com/security/cve/CVE-2026-33814
suse.com/security/cve/CVE-2026-34986
suse.com/security/cve/CVE-2026-39821
suse.com/security/cve/CVE-2026-39827
suse.com/security/cve/CVE-2026-39828
suse.com/security/cve/CVE-2026-39829
suse.com/security/cve/CVE-2026-39830
suse.com/security/cve/CVE-2026-39831
suse.com/security/cve/CVE-2026-39832
suse.com/security/cve/CVE-2026-39833
suse.com/security/cve/CVE-2026-39834
suse.com/security/cve/CVE-2026-39835
suse.com/security/cve/CVE-2026-42039
suse.com/security/cve/CVE-2026-42502
suse.com/security/cve/CVE-2026-42506
suse.com/security/cve/CVE-2026-42508
suse.com/security/cve/CVE-2026-46595
suse.com/security/cve/CVE-2026-46597
suse.com/security/cve/CVE-2026-46598