CVE-2025-24358

gorilla/csrf CSRF vulnerability due to broken Referer validation

Published Apr 15, 2025 CVSS 4.0 · 5.4 Medium EPSS < 1% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4151-1 golang-github-gorilla-csrf security update
EUVD EUVD EUVD-2025-10883 gorilla/csrf CSRF vulnerability due to broken Referer validation
Github GHSA Github GHSA GHSA-rq77-p4h8-4crw gorilla/csrf CSRF vulnerability due to broken Referer validation
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title gorilla/csrf CSRF vulnerability due to broken Referer validation
Weaknesses CWE-352
References
Metrics cvssV4_0

{'score': 5.4, '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'}

Subscriptions

No data.

Weaknesses

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
May 1, 2025, 11:02 AM
Reserved
Jan 20, 2025, 3:18 PM
Status
Deferred
Published
Apr 15, 2025, 7:16 PM
Modified
Jun 17, 2026, 8:58 AM