Vulnerability · Published Aug 29, 2025 · Assigned by Go

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

High 7.3

In plain English

A high-severity security flaw in github.com/gorilla/csrf from github.com/gorilla/csrf. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 6% of all known vulnerabilities).

Severity (CVSS 3.1)7.3High
Exploit odds (30 days)0.2%top 93.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12golang-github-gorilla-csrfno fix listedDEBIAN-CVE-2025-47909
Debian:13golang-github-gorilla-csrfno fix listedDEBIAN-CVE-2025-47909
Debian:14golang-github-gorilla-csrfno fix listedDEBIAN-CVE-2025-47909
Gogithub.com/gorilla/csrfno fix listedGHSA-82ff-hg59-8x73
Gogithub.com/gorilla/csrfno fix listedGO-2025-3884
Ubuntu:22.04:LTSgolang-github-gorilla-csrfno fix listedUBUNTU-CVE-2025-47909
Ubuntu:24.04:LTSgolang-github-gorilla-csrfno fix listedUBUNTU-CVE-2025-47909
Ubuntu:25.10golang-github-gorilla-csrfno fix listedUBUNTU-CVE-2025-47909
Ubuntu:26.04:LTSgolang-github-gorilla-csrfno fix listedUBUNTU-CVE-2025-47909
Ubuntu:26.10golang-github-gorilla-csrfno fix listedUBUNTU-CVE-2025-47909

Affected products (as reported)

VendorProductVersions
github.com/gorilla/csrf github.com/gorilla/csrf see references

Weakness: CWE-346 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L

References