GHSA-82ff-hg59-8x73

Suggest an improvement
Source
https://github.com/advisories/GHSA-82ff-hg59-8x73
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/08/GHSA-82ff-hg59-8x73/GHSA-82ff-hg59-8x73.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-82ff-hg59-8x73
Aliases
Related
Published
2025-08-29T20:23:16Z
Modified
2025-08-29T21:14:35.387800Z
Severity
  • 4.6 (Medium) CVSS_V4 - 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:U CVSS Calculator
Summary
github.com/gorilla/csrf improperly validates TrustedOrigins allowing CSRF attacks
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.

Database specific
{
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2025-08-29T20:23:16Z",
    "nvd_published_at": "2025-08-29T16:15:35Z",
    "cwe_ids": [
        "CWE-352",
        "CWE-807"
    ]
}
References

Affected packages

Go / github.com/gorilla/csrf

Package

Name
github.com/gorilla/csrf
View open source insights on deps.dev
Purl
pkg:golang/github.com/gorilla/csrf

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Last affected
1.7.3