CVE-2025-47909

Improper validation of TrustedOrigins allows CSRF attacks in github.com/gorilla/csrf

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.

Category

7.3
CVSS
Severity: High
CVSS 3.1 •
Affected: github.com/gorilla/csrf github.com/gorilla/csrf
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2025-47909?
CVE-2025-47909 has been scored as a high severity vulnerability.
How to fix CVE-2025-47909?
To fix CVE-2025-47909, make sure you are using an up-to-date version of the affected component(s) by checking the vendor release notes. As for now, there are no other specific guidelines available.
Is CVE-2025-47909 being actively exploited in the wild?
As for now, there are no information to confirm that CVE-2025-47909 is being actively exploited.
What software or system is affected by CVE-2025-47909?
CVE-2025-47909 affects github.com/gorilla/csrf github.com/gorilla/csrf.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.