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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| github.com/gorilla/csrf | github.com/gorilla/csrf | — | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | golang-github-gorilla-csrf | No fix yet | — |
| Debian 13 | golang-github-gorilla-csrf | No fix yet | — |
| Debian 12 | golang-github-gorilla-csrf | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | golang-github-gorilla-csrf | No fix yet | — |
| Ubuntu 26.04 LTS | golang-github-gorilla-csrf | No fix yet | — |
| Ubuntu 25.10 | golang-github-gorilla-csrf | No fix yet | — |
| Ubuntu 24.04 LTS | golang-github-gorilla-csrf | No fix yet | — |
| Ubuntu 22.04 LTS | golang-github-gorilla-csrf | No fix yet | — |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | golang-github-gorilla-csrf | No fix yet | — |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| Go | github.com/gorilla/csrf | <= 1.7.3 | — | GHSA-82ff-hg59-8x73 |
| Go | github.com/gorilla/csrf | >= 1.7.3 | — | GO-2025-3884 |