Skip to content

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

MediumCVSS 5.4 EPSS 0.38%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: no · technical impact: partial
Technology
UbuntuDebian

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.

Upgrade path

9 packages: 3 fixed, 5 with no fix yet.

PackageAffectedFixed inStatus
debian/golang-github-gorilla-csrf(Debian 12) = 1.7.1-1; = 1.7.2+ds1-1; = 1.7.2+ds1-2; = 1.7.2+ds1-3 +3 more No fix listed No fix yet
ubuntu/golang-github-gorilla-csrf(Ubuntu 22.04) All versions No fix listed No fix yet
ubuntu/golang-github-gorilla-csrf(Ubuntu 24.04) All versions No fix listed No fix yet
ubuntu/golang-github-gorilla-csrf(Ubuntu 26.04) All versions No fix listed No fix yet
ubuntu/golang-github-gorilla-csrf(Ubuntu 26.10) All versions No fix listed No fix yet
debian/golang-github-gorilla-csrf(Debian 13) < 1.7.2+ds1-2 1.7.2+ds1-2 Fixed
debian/golang-github-gorilla-csrf(Debian 14) < 1.7.2+ds1-2 1.7.2+ds1-2 Fixed
gorilla github.com/gorilla/csrf(Go) < 1.7.3 1.7.3 Fixed
gorilla github.com/gorilla/csrf = < 1.7.3 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
gorilla github.com/gorilla/csrf(Go) < 1.7.3 1.7.3
debian/golang-github-gorilla-csrf(Debian:12) All versions No fix listed
debian/golang-github-gorilla-csrf(Debian:12) = 1.7.1-1 No fix listed
debian/golang-github-gorilla-csrf(Debian:12) = 1.7.2+ds1-1 No fix listed
debian/golang-github-gorilla-csrf(Debian:12) = 1.7.2+ds1-2 No fix listed
debian/golang-github-gorilla-csrf(Debian:12) = 1.7.2+ds1-3 No fix listed
debian/golang-github-gorilla-csrf(Debian:12) = 1.7.2-1 No fix listed
debian/golang-github-gorilla-csrf(Debian:12) = 1.7.2-1~bpo12+1 No fix listed
debian/golang-github-gorilla-csrf(Debian:13) < 1.7.2+ds1-2 1.7.2+ds1-2
debian/golang-github-gorilla-csrf(Debian:14) < 1.7.2+ds1-2 1.7.2+ds1-2
gorilla github.com/gorilla/csrf = < 1.7.3 No fix listed
ubuntu/golang-github-gorilla-csrf(Ubuntu:22.04) All versions No fix listed
ubuntu/golang-github-gorilla-csrf(Ubuntu:24.04) All versions No fix listed
ubuntu/golang-github-gorilla-csrf(Ubuntu:26.04) All versions No fix listed
ubuntu/golang-github-gorilla-csrf(Ubuntu:26.10) All versions No fix listed

References