CWE-346Weakness · CWE-346

CVE-2025-47909

HIGH · 7.3 CVSS v3.1 Published 2025-08-29
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
82/100
Remediation priority · High
Remotely reachable No privileges Zero-click

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 · unedited
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.

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 confidence

In 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.

MitigationMigrate 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.

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 checks

Work through these to decide whether this CVE applies to you.

  1. Identify gorilla/csrf usage
    Search your Go module dependencies (go.mod, go.sum) or vendor directory for 'gorilla/csrf' import and note the version string
    Affected if The package gorilla/csrf is present and its version is below the fixed version (check your version against the official advisory)
  2. Check if TrustedOrigins is configured
    Inspect 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)
  3. Verify Origin header validation behavior
    Test 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.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

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 · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Migrate 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.

Recommended fix Moderate confidence

Go 1.25+ with net/http.CrossOriginProtection, or filippo.io/csrf (latest)

  1. 1. Identify all Go applications using the gorilla/csrf package or custom CSRF middleware with TrustedOrigins configuration
  2. 2. For immediate fix: Replace the CSRF middleware with the filippo.io/csrf backport module (go get filippo.io/csrf)
  3. 3. If using gorilla/csrf API: Migrate to filippo.io/csrf/gorilla for drop-in replacement (go get filippo.io/csrf/gorilla)
  4. 4. Alternatively, upgrade to Go 1.25 or later which includes net/http.CrossOriginProtection
  5. 5. Review TrustedOrigins configuration and remove any entries that are not strictly required
  6. 6. Test that CSRF protection still functions correctly after migration
  7. 7. Ensure production deployments use HTTPS for all protected endpoints
Caveat If migrating from gorilla/csrf to filippo.io/csrf/gorilla, review API compatibility; Go 1.25 may require code changes to use the new CrossOriginProtection API

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation2.0 h
  • Implementation4.0 h
  • Testing6.0 h
  • Review / QA2.0 h
14.0 hours of engineering $2,380
Get help mitigating

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 locally
dbcve dependency scanner

Check 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 sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2025-47909 in production — separate from our analysis above.

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.

What this is

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.

What belongs here
  • 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