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

Published Aug 29, 2025
·
Updated

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 Software

4 affected components
go Go>=1.25
Filippo csrf
Gorilla csrf
go/github.com/gorilla/csrf<=1.7.3

Event History

Aug 29, 2025
CVE Published
via MITRE·03:55 PM
Data Sourced
via MITRE·03:55 PM
DescriptionWeakness
Data Sourced
via NVD·04:15 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·08:23 PM
Data Sourced
via GitHub·08:23 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-47909?

CVE-2025-47909 is considered a medium severity vulnerability due to its potential for CSRF attacks.

2

How do I fix CVE-2025-47909?

To fix CVE-2025-47909, ensure that your application does not use trusted origins that unnecessarily allow requests from corresponding HTTP origins.

3

What type of attack does CVE-2025-47909 allow?

CVE-2025-47909 allows network attackers to perform Cross-Site Request Forgery (CSRF) attacks.

4

Which software is affected by CVE-2025-47909?

CVE-2025-47909 affects applications built with Go version 1.25 and may also impact libraries like Filippo csrf and Gorilla csrf.

5

What is the main risk associated with CVE-2025-47909?

The main risk associated with CVE-2025-47909 is that it can allow an attacker to trick a user’s browser into sending unauthorized requests to a target server.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203