CVE-2025-47909
published high CVSS 3.1 · 7.3Improper validation of TrustedOrigins allows CSRF attacks in github.com/gorilla/csrf
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| github.com/gorilla/csrf | — | github.com/gorilla/csrf0 to < 1.7.3 · Other versions: affected | Unaffected | Not stated | Go |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.3 / 10
- Severity
- high
- Provider
- CISA-ADP · adp
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| github.com/gorilla/csrf | github.com/gorilla/csrf | 0 to < 1.7.3 (unaffected · semver)Default: affected | Go · cna |
Weaknesses
2- CWE-346 CWE-346: Origin Validation Error
- CWE-346 CWE-346 Origin Validation Error
References
2Provider assertions
2Go · cna
Improper validation of TrustedOrigins allows CSRF attacks in github.com/gorilla/csrf
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.1
- Searchable
- yes
- Content hash
- 4b2d16ca3701f486bda4a990c5ba48814de8b92cbff771e06985436736938e98
- Ingested
- 23 Sep 2026, 08:50:18 UTC
- Source record
- Official CVE record