CVE-2025-47909
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedHosts 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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceIn gorilla/csrf (or similar Go CSRF middleware), TrustedOrigins allows both HTTP and HTTPS origins for a given host due to schema being ignored in the Origin header check against a synthetic URL. This enables a network attacker to host a malicious form on http://trusted-origin.example to submit to https://trusted-origin.example, bypassing CSRF protections.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- Low
- Integrity
- Low
- Availability
- Low
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify gorilla/csrf usageSearch your Go module dependencies (go.mod, go.sum) or vendor directory for 'gorilla/csrf' import and note the version stringAffected if The package gorilla/csrf is present and its version is below the fixed version (check your version against the official advisory)
-
Check if TrustedOrigins is configuredInspect your application's CSRF middleware configuration for the TrustedOrigins setting (typically passed to csrf.Protect() or in a config struct). Look for code that sets trusted origin domains or host patterns.Affected if TrustedOrigins is configured with domain(s) that accept both HTTP and HTTPS schemes (the vulnerability applies when both schemes are allowed for the same host)
-
Verify Origin header validation behaviorTest your application by sending requests with different Origin headers: one with http:// and one with https:// for the same host. Compare how the application handles each. If both are accepted for a trusted origin, the vulnerability may be present.Affected if Both http://trusted-origin.example and https://trusted-origin.example origins are accepted by the CSRF middleware for the same protected endpoint
Your environment is affected if gorilla/csrf is in use with a vulnerable version AND TrustedOrigins is configured to accept both HTTP and HTTPS schemes for the same host, allowing cross-scheme CSRF bypass.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scopedMigrate to net/http.CrossOriginProtection (Go 1.25), or apply the backport module filippo.io/csrf (or filippo.io/csrf/gorilla for API compatibility), which properly validates the full origin including scheme.
Go 1.25+ with net/http.CrossOriginProtection, or filippo.io/csrf (latest)
- 1. Identify all Go applications using the gorilla/csrf package or custom CSRF middleware with TrustedOrigins configuration
- 2. For immediate fix: Replace the CSRF middleware with the filippo.io/csrf backport module (go get filippo.io/csrf)
- 3. If using gorilla/csrf API: Migrate to filippo.io/csrf/gorilla for drop-in replacement (go get filippo.io/csrf/gorilla)
- 4. Alternatively, upgrade to Go 1.25 or later which includes net/http.CrossOriginProtection
- 5. Review TrustedOrigins configuration and remove any entries that are not strictly required
- 6. Test that CSRF protection still functions correctly after migration
- 7. Ensure production deployments use HTTPS for all protected endpoints
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation4.0 h
- Testing6.0 h
- Review / QA2.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,808.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2025-47909 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2025-47909 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data