Update module github.com/gorilla/csrf to v1.7.3 [SECURITY] #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "renovate/go-github.com-gorilla-csrf-vulnerability"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
v1.7.2→v1.7.3github.com/gorilla/csrf improperly validates TrustedOrigins allowing CSRF attacks
CVE-2025-47909 / GHSA-82ff-hg59-8x73 / GO-2025-3884
More information
Details
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.
Severity
CVSS:4.0/AV:A/AC:L/AT:N/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:UReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
gorilla/csrf CSRF vulnerability due to broken Referer validation
CVE-2025-24358 / GHSA-rq77-p4h8-4crw / GO-2025-3607
More information
Details
Summary
gorilla/csrf is vulnerable to CSRF via form submission from origins that share a top level domain with the target origin.
Details
gorilla/csrf does not validate the Origin header against an allowlist. Its executes its validation of the Referer header for cross-origin requests only when it believes the request is being served over TLS. It determines this by inspecting the
r.URL.Schemevalue. However, this value is never populated for "server" requests per the Go spec, and so this check does not run in practice.PoC
target.example.testprotected with gorilla/csrf and served over TLS hosting form on/submitattack.example.testserved over TLStarget.example.testdomain=.example.test and path=/submit/(the default for CSRF cookies) it will be sent first by the browser on submit to our target originattack.example.testwith exfiltrated CSRF form tokenattack.example.testOrigin / Referer headers are not validated.Impact
This vulnerability allows an attacker who has gained XSS on a subdomain or top level domain to perform authenticated form submissions against gorilla/csrf protected targets that share the same top level domain.
This bug has existed in gorilla/csrf since its initial release in 2015.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:PReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
gorilla/csrf CSRF vulnerability due to broken Referer validation in github.com/gorilla/csrf
CVE-2025-24358 / GHSA-rq77-p4h8-4crw / GO-2025-3607
More information
Details
gorilla/csrf CSRF vulnerability due to broken Referer validation in github.com/gorilla/csrf
Severity
Unknown
References
This data is provided by OSV and the Go Vulnerability Database (CC-BY 4.0).
Release Notes
gorilla/csrf (github.com/gorilla/csrf)
v1.7.3Compare Source
This Release fixes the following:
Full Changelog: https://github.com/gorilla/csrf/compare/v1.7.2...v1.7.3
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.