CVE-2025-47909Improper validation of TrustedOrigins allows CSRF attacks in github.com/gorilla/csrf
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.
What to do
Debian, Go, Ubuntu have not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | golang-github-gorilla-csrf | Fix pending | UBUNTU-CVE-2025-47909 | |
| Ubuntu 26.04 | golang-github-gorilla-csrf | Under investigation | UBUNTU-CVE-2025-47909 | |
| Ubuntu 25.10 | golang-github-gorilla-csrf | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2025-47909 | |
| Ubuntu 24.04 | golang-github-gorilla-csrf | Under investigation | UBUNTU-CVE-2025-47909 | |
| Ubuntu 22.04 | golang-github-gorilla-csrf | Under investigation | UBUNTU-CVE-2025-47909 | |
| Ubuntu 20.04 | golang-github-gorilla-csrf | Fix pending | UBUNTU-CVE-2025-47909 | |
| Debian 14 | golang-github-gorilla-csrf | Fix pending | DEBIAN-CVE-2025-47909 | |
| Debian 13 | golang-github-gorilla-csrf | Fix pending | DEBIAN-CVE-2025-47909 | |
| Debian 12 | golang-github-gorilla-csrf | Fix pending | DEBIAN-CVE-2025-47909 | |
| Go library | github.com/gorilla/csrf | Fix pending | GHSA-82ff-hg59-8x73 |
What the vendor says
As published in the CVE record by Go, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- github.com/gorilla/csrf
References
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.