Skip to content

CVE-2025-47909 Improper validation of TrustedOrigins allows CSRF attacks in github.com/gorilla/csrf

HighCVSS 7.3 EPSS 0.18%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: yes · technical impact: partial
Technology
UbuntuDebian

Description

Hosts listed in TrustedOrigins implicitly allow requests from the corresponding HTTP origins, allowing network MitMs to perform CSRF attacks. After the CVE-2025-24358 fix, a network attacker that places a form at http://example.com can't get it to submit to https://example.com because the Origin header is checked with sameOrigin against a synthetic URL. However, if a host is added to TrustedOrigins, both its HTTP and HTTPS origins will be allowed, because the schema of the synthetic URL is ignored and only the host is checked. For example, if an application is hosted on https://example.com and adds example.net to TrustedOrigins, a network attacker can serve a form at http://example.net to perform the attack. Applications should migrate to net/http.CrossOriginProtection, introduced in Go 1.25. If that is not an option, a backport is available as a module at filippo.io/csrf, and a drop-in replacement for the github.com/gorilla/csrf API is available at filippo.io/csrf/gorilla.

Upgrade path

8 packages: 0 fixed, 1 partially fixed, 7 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
debian/golang-github-gorilla-csrf(Debian 13) = 1.7.2+ds1-2; = 1.7.2+ds1-3; All versions No fix listed No fix yet
debian/golang-github-gorilla-csrf(Debian 14) = 1.7.2+ds1-2; = 1.7.2+ds1-3; All versions 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
gorilla github.com/gorilla/csrf(Go) <= 1.7.3; >= 1.7.3 after 1.7.3 Partially fixed

Affected products

ProductAffected versionsFixed in
gorilla github.com/gorilla/csrf(Go) <= 1.7.3 No fix listed
gorilla github.com/gorilla/csrf(Go) >= 1.7.3 No fix listed
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) All versions No fix listed
debian/golang-github-gorilla-csrf(Debian:13) = 1.7.2+ds1-2 No fix listed
debian/golang-github-gorilla-csrf(Debian:13) = 1.7.2+ds1-3 No fix listed
debian/golang-github-gorilla-csrf(Debian:14) All versions No fix listed
debian/golang-github-gorilla-csrf(Debian:14) = 1.7.2+ds1-2 No fix listed
debian/golang-github-gorilla-csrf(Debian:14) = 1.7.2+ds1-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