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

High 7.3 Published Updated

Network attackers can bypass CSRF protections via TrustedOrigins misconfiguration, allowing cross-site request forgery attacks against Go applications.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-47909?

CVE-2025-47909 is a high-severity vulnerability in github.com/gorilla/csrf, published on 29 Aug 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

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.

Weakness: CWE-346

Which versions are affected by CVE-2025-47909?

3 open source packages ship an affected version, including github.com/gorilla/csrf.

PackageAffectedFixed in
github.com/gorilla/csrf GoAll versions to 1.7.3None
github.com/gorilla/csrf GoAll versions to 1.7.3None
github.com/gorilla/csrf GoFrom 1.7.3None

How do I fix CVE-2025-47909?

Upgrade to a fixed version.

Is CVE-2025-47909 being exploited?

There is no known exploitation of CVE-2025-47909 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2025-47909, ECHO-03c6-4c08-d89d, GHSA-82ff-hg59-8x73, GO-2025-3884, MINI-2xw7-mgw7-xv73, MINI-62r2-xxh4-hxvp and 8 more.

Is CVE-2025-47909 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free